【问题标题】:Insert into bucketed table produces empty table插入分桶表会产生空表
【发布时间】:2017-05-02 14:41:20
【问题描述】:

我正在尝试插入分桶表。当我运行查询时,一切看起来都很好,我在报告中看到了一些写入的字节。 Hive 日志中也没有任何错误。
但是当我查看表格时,我什么都没有:(

创建表test(
test_date string,
test_id string,
test_title string,)
由 (
文本日期)
入 100 桶
行格式分隔
以“|”结尾的字段
以“\n”结尾的行
存储为兽人
位置
'hdfs://myserver/data/hive/databases/test.db/test'
TBLPROPERTIES (
'skip.header.line.count'='1',
'事务' = 'true')

插入到 test.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:地图:6 减少:100 累积 CPU:423.34 秒
HDFS 读取:148450105
HDFS 写入:9282219
成功

hive> 从 test.test 限制 2 中选择 *;
好的
耗时:0.124 秒
蜂巢>

【问题讨论】:

    标签: hadoop hive hdfs hiveql orc


    【解决方案1】:

    这个查询真的有效吗?行后有多余的逗号

    test_title string,)
    

    您的列定义中也没有 text_date。你的意思是 test_date 吗?

    CLUSTERED BY (text_date)
    

    【讨论】:

      猜你喜欢
      • 2020-05-09
      • 2019-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多