我想爲基於AVRO的表創建不同的架構。以下是m使用的命令。我可以看到具有.avro擴展名的所有數據文件的正確目錄結構,但是當我登錄到HIVE &時,執行show table; retail_avro.db模式下不存在表表未使用sqoop導入全部創建
sqoop import-all-tables \
--m 2 \
--connect "jdbc:mysql://quickstart.cloudera:3306/retail_db" \
--username=retail_dba \
--password=cloudera \
--warehouse-dir=/user/hive/warehouse/retail_avro.db \
--create-hive-table \
--as-avrodatafile
後低於上述命令是輸出,如果我訪問使用HDFS命令:
[[email protected] ~]$ hdfs dfs -ls /user/hive/warehouse/retail_avro.db
Found 6 items
drwxr-xr-x - cloudera hive 0 2016-12-30 04:25 /user/hive/warehouse/retail_avro.db/categories
drwxr-xr-x - cloudera hive 0 2016-12-30 04:25 /user/hive/warehouse/retail_avro.db/customers
drwxr-xr-x - cloudera hive 0 2016-12-30 04:25 /user/hive/warehouse/retail_avro.db/departments
drwxr-xr-x - cloudera hive 0 2016-12-30 04:25 /user/hive/warehouse/retail_avro.db/order_items
drwxr-xr-x - cloudera hive 0 2016-12-30 04:26 /user/hive/warehouse/retail_avro.db/orders
drwxr-xr-x - cloudera hive 0 2016-12-30 04:26 /user/hive/warehouse/retail_avro.db/products
[[email protected] ~]$
[[email protected] ~]$
[[email protected] ~]$ hdfs dfs -ls /user/hive/warehouse/retail_avro.db/categories
Found 3 items
-rw-r--r-- 1 cloudera hive 0 2016-12-30 04:25 /user/hive/warehouse/retail_avro.db/categories/_SUCCESS
-rw-r--r-- 1 cloudera hive 1007 2016-12-30 04:25 /user/hive/warehouse/retail_avro.db/categories/part-m-00000.avro
-rw-r--r-- 1 cloudera hive 959 2016-12-30 04:25 /user/hive/warehouse/retail_avro.db/categories/part-m-00001.avro
,當我登錄到HIVE:
hive> use retail_avro;
OK
Time taken: 1.942 seconds
hive> show tables;
OK
Time taken: 0.518 seconds
hive> select * from departments;
FAILED: SemanticException [Error 10001]: Line 1:14 Table not found 'departments'
那麼什麼是使用這種--create蜂箱表參數的個數??? – AJm
--create-hive-table args。這個選項說如果表不存在,它會創建它。 – AJm
箱子配置單元表avro https://cwiki.apache.org/confluence/display/Hive/AvroSerDe .. –