本篇教程探讨了大数据技术之Hive使用十六进制分隔符异常分析,希望阅读本篇文章以后大家有所收获,帮助大家对相关内容的理解更加深入。
1.问题描述
通过sqoop抽取Mysql表数据到hive表,发现hive表所有列显示为null
Hive表的分隔符为“\u001B”,sqoop指定的分隔符也是“\u001B”
通过命令show create table test_hive_delimiter查看建表语句如下:
0: jdbc:hive2://localhost:10000/> show create table test_hive_delimiter;...INFO : OK+----------------------------------------------------+--+| createtab_stmt |+----------------------------------------------------+--+| CREATE EXTERNAL TABLE `test_hive_delimiter`( || `id` int, || `name` string, || `address` string) || ROW FORMAT SERDE || 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' || WITH SERDEPROPERTIES ( || 'field.delim'='\u0015', || 'serialization.format'='\u0015') || STORED AS INPUTFORMAT || 'org.apache.hadoop.mapred.TextInputFormat' || OUTPUTFORMAT || 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' || LOCATION || 'hdfs://ip-172-31-6-148.fayson.com:8020/fayson/test_hive_delimiter' || TBLPROPERTIES ( || 'COLUMN_STATS_ACCURATE'