我正在尝试插入分桶表。当我运行查询时,一切看起来都很好,我在报告中看到了一些写入的字节数。 Hive 日志中也没有任何错误。
但是当我查看表格时,我什么都没有:(
创建表测试
(
测试日期
字符串,
test_id
字符串,
test_title
字符串,)
聚类为 (
文本日期)
进入 100 个桶
行格式分隔
由“|”终止的字段
由 '\n' 终止的行
存储为兽人
地点
'hdfs://myserver/data/hive/databases/test.db/test'
TBL属性(
'skip.header.line.count'='1',
'交易' = '真')
插入测试.test
从 test2.green 中选择“test_date”、“test_id”、“test_title”
结果
结束作业 = job_148140234567_254152
加载数据到表test.test
表 test.teststats:[numFiles=100,numRows=1601822,totalSize=9277056,rawDataSize=0]
启动 MapReduce 作业:
Stage-Stage-1: map :6 减少:100 累计 CPU:423.34 秒
HDFS 读取:148450105
HDFS写入:9282219
成功
hive> select * from test.test limit 2;
好的
耗时:0.124秒
hive >
最佳答案
这个查询真的有效吗?行后有多余的逗号
test_title string,)
还可以将 text_date 不在您的列定义中。也许你是说 test_date?
CLUSTERED BY (text_date)
关于hadoop - 插入分桶表产生空表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41190524/