【问题标题】:datastax cqlsh alter table add column ,but can not see the column in hive , how?datastax cqlsh alter table add column,但在hive中看不到该列,怎么办?
【发布时间】:2013-09-26 01:56:45
【问题描述】:
cqlsh:test> alter table example  add  t int;
then , 
bash$dse hive 
hive> use test; desc example;
OK
k       int     from deserializer
v       string  from deserializer

在 hive 中看不到新列 t。 dse 版本是 3.1.3。

我需要做什么?

【问题讨论】:

    标签: hadoop cassandra hive datastax-enterprise


    【解决方案1】:

    您不需要删除任何键空间或重新启动 DSE 或 Hive,只需删除 Hive 表并让 DSE 通过发出 use 命令重新创建它。

    hive> desc ex;
    OK
    k   int from deserializer
    v   string  from deserializer
    Time taken: 0.054 seconds
    hive> drop table ex;
    OK
    Time taken: 0.051 seconds
    hive> desc ex;      
    OK
    Table ex does not exist      
    Time taken: 0.051 seconds
    hive> use foo;
    OK
    Time taken: 0.035 seconds
    hive> desc ex;
    OK
    k   int from deserializer
    t   int from deserializer
    v   string  from deserializer
    Time taken: 0.042 seconds
    

    编辑:同样可以通过 DROP TABLE 后跟 SHOW TABLES(即 SHOW TABLES 而不是 USE)来实现。根据 DataStax 文档:http://www.datastax.com/docs/datastax_enterprise3.1/solutions/about_hive#handling-schema-changes

    【讨论】:

      【解决方案2】:

      删除 HiveMetaStore 键空间和 MetaStore 列族。然后重启DSE,重启HIVE,你应该有一个全新的开始

      【讨论】:

      • 我使用beobal的方法:drop table in hive,然后使用db,就可以了。
      猜你喜欢
      • 2011-02-06
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 2011-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-05
      相关资源
      最近更新 更多