我在将mysql数据加载到hive2时遇到了一些问题,并且不知道如何指定分隔符,我试了好几次,但都没有结果。
下面是 hive 的table, id
是分区列,
0: jdbc:hive2://localhost/> desc test;
+-----------+------------+----------+
| col_name | data_type | comment |
+-----------+------------+----------+
| a | string | |
| id | int | |
+-----------+------------+----------+
当我执行
load data local inpath 'file:///root/test' into table test partition (id=1);
上面写着:
Invalid path ''file:///root/test'': No files matching path file
但它确实存在。
我希望按指定的文件进行动态分区,因此我将列添加到文件中,如下所示:
root@<namenode|~>:#cat /root/test
a,1
b,2
但它也失败了,医生对此只字不提,我猜它现在不支持。有人知道吗?任何帮助都将不胜感激!
1条答案
按热度按时间qzlgjiam1#
如果您想指定列sperators,它使用命令;
用分隔符替换“,”
另外,如果要对配置单元表进行分区,请指定要在使用时终止的列;