Dear All,
i’m sorry to come with very basic question, but i was not able to find any answer and whatever i tried did not work.
How can I write equivalent to this PostgreSQL function in Dremio?
select json_build_object(‘linked,’,t1.linkedin_url,‘twitter’,t1.linkedin_url) from table t1
Thank you for help,
Jaro
Dremio support for constructing complex types out of primitives is not great. But something hacky like this works:
drop table IF EXISTS temp;
create table temp
as select '{name:"' || "c_name" || '"}' as c1
from cp."customer.parquet";
select convert_from(c1, 'json') as obj
from temp;
select obj['name'] as name
from (select convert_from(c1, 'json') as obj from temp);