当前位置:网站首页>Consolidation of Questionnaire Questions and Answers

Consolidation of Questionnaire Questions and Answers

2022-08-09 09:22:00 research monk who doesn't like research

The obtained question and answer are in json format, and the field is map. It is necessary to separate the serial number from the following questions or answers. The method of lateral view explode is used. Compared with explode, lateral view explode can select non-burst field

It should be noted that the two fields after the explosion do not need parentheses. If there is a where, where is placed at the end

 select q_key, q_valuefrom questionnairelateral view explode(questions) t as q_key, q_value

You can use lateral view explode multiple times

 select q_key, q_value, a_key, a_valuefrom questionnairelateral view explode(questions) t as q_key, q_valuelateral view explode(answers) t2 as a_key, a_valuewhere q_key=a_key 
原网站

版权声明
本文为[research monk who doesn't like research]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208090911567594.html