造一行常量数据SQL
select “col1”,“col2”,“col3”
造多行多列
select concat('AAA', ':', "BBB", '_PP', ':', "XXXXX") as key1,concat('{"Id":"',"12323213",'","url":"',"http://helloworld.com/hello.html",'","code":"',"hello",'"}') as key2
union
select concat('AAA', ':', "BBB", '_PP', ':', "YYYYY") as key1,concat('{"Id":"',"12323213",'","url":"',"http://helloworld.com/hello.html",'","code":"',"hello",'"}') as key2
{“Id”:“12323213”,“url”:“http://helloworld.com/hello.html”,“code”:“hello”}
行列数据转为结构体数组
select array(named_struct('name',name,'age',age) ) from (
select concat('AAA', ':', "BBB", '_PP', ':', "XXXXX") as name,concat('{"Id":"',"12323213",'","url":"',"http://helloworld.com/hello.html",'","code":"',"hello",'"}') as age
union
select concat('AAA', ':', "BBB", '_PP', ':', "YYYYY") as name,concat('{"Id":"',"12323213",'","url":"',"http://helloworld.com/hello.html",'","code":"',"hello",'"}') as age
)