Imported the table from mysql to parquet and then created external table in hive. Somehow, when I query the external table on hive, it shows all values as null. Although the parquet-tools cat xyz.parquet file shows the contents properly. Where am I doing the mistake ?
sqoop import --connect jdbc:mysql://quickstart.cloudera:3306/retail_db \
--username root --password cloudera \
--table order_items --split-by page_id \
--target-dir hdfs:/user/cloudera/proj/order_items \
--compress --compression-codec snappy \
--as-parquetfile \
--num-mappers 1
Create external table hiveorderitems_par
(ord_item_id int,
ord_item_ord_id int,
ord_item_prod_id int,
ord_item_quantity int,
ord_item_subtotal float,
order_item_prod_price float)
row format SERDE 'parquet.hive.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT "parquet.hive.DeprecatedParquetInputFormat"
OUTPUTFORMAT "parquet.hive.DeprecatedParquetOutputFormat"
location "/user/cloudera/proj/order_items";
hive> select * from hiveorderitems_par;
NULL NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
Time taken: 0.225 seconds, Fetched: 172198 row(s)
hive>