【问题标题】:Data not being populated after altering the hive table更改配置单元表后未填充数据
【发布时间】:2018-01-10 10:13:21
【问题描述】:

我有一个 hive 表,它由 HDFS 位置中的底层 parquet 文件填充。现在,我通过更改列名更改了表架构,但现在该列被填充为 NULL 而不是 parquet 中的原始数据。

【问题讨论】:

  • 使用 Avro 和/或 Parquet 的好处是能够发展架构,这就是您现在所面临的。提供有关确切更改或一些更改示例的更多信息,例如数据类型更改、新的附加列、默认值等。
  • 较早的表具有类型为“string”的列名,如“sta_dte”,默认值为“9999-12-31”,后来转换为具有相同类型和默认值的“start_date”。但他们没有被填充
  • 试试aliases: ["old_column_name"]
  • 你能详细说明一下吗!

标签: hive hdfs parquet


【解决方案1】:

试试这个。打开.avsc 文件。对于该列,您会发现类似

{
    "name" : "start_date",
    "type" : [ "null", "string" ],
    "default" : null,
    "columnName" : "start_date",
    "sqlType" : "12"
  } 

添加别名

{
    "name" : "start_date",
    "type" : [ "null", "string" ],
    "default" : null,
    "columnName" : "start_date",
    "aliases" : [ "sta_dte" ],
    "sqlType" : "12"
  } 

【讨论】:

    猜你喜欢
    • 2016-07-05
    • 2018-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多