mercredi 28 mai 2014

Hadoop - datastax cqlsh alter table ajouter colonne, mais ne voyez pas la colonne dans la ruche, comment ? -Débordement de pile


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

The new column t is cannot be seen in hive. dse version is 3.1.3.


What do need I do?




You don't need to drop any keyspaces or restart DSE or Hive, just drop the Hive table and let DSE recreate it by issuing a use command.


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

Edit: the same can be achieved by DROP TABLE followed by SHOW TABLES (i.e. SHOW TABLES instead of USE). As per the DataStax docs: http://www.datastax.com/docs/datastax_enterprise3.1/solutions/about_hive#handling-schema-changes




Drop HiveMetaStore keyspace and MetaStore column family. Then restart DSE, restart HIVE, you should have a fresh start



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

The new column t is cannot be seen in hive. dse version is 3.1.3.


What do need I do?



You don't need to drop any keyspaces or restart DSE or Hive, just drop the Hive table and let DSE recreate it by issuing a use command.


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

Edit: the same can be achieved by DROP TABLE followed by SHOW TABLES (i.e. SHOW TABLES instead of USE). As per the DataStax docs: http://www.datastax.com/docs/datastax_enterprise3.1/solutions/about_hive#handling-schema-changes



Drop HiveMetaStore keyspace and MetaStore column family. Then restart DSE, restart HIVE, you should have a fresh start


0 commentaires:

Enregistrer un commentaire