hive 建表 数组,结构体, map


create table test_set(
id INT,
name STRING,
hobby ARRAY<STRING>,    //array中元素为String类型
friend MAP<STRING,STRING>,    //map中键和值均为String类型
mark struct<math:int,english:int>   //Struct中元素为Int类型
)
row format delimited fields terminated by ','   //字段之间用','分隔
collection items terminated by '_'     //集合中的元素用'_'分隔
map keys terminated by ':'      //map中键值对之间用':'分隔
lines terminated by '\n       //行之间用'\n'分隔
 

以上是 在数组中插入结构体  map  以及  key:value 的形式.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM