Need to add a constant value in a column while loading a hive table -


I have created a table named table 1 in the hive and I need to insert data from table 2 to table 1. I Use the given statement to get the following Apart from this, I need to add a new column with some fixed value - Colx = 'colval' with columns in table 2, but I'm sure how to add it .. Thanks!

Insert in table table * Select from Table 2;

If you drop table1 and rebuild it from scratch, Can:

  - I'm using the hive 0.13.0 drop table if existing table 1; Select table 1 as table *, from telegram to table 2 as 'colval';  

If this is not an option for some reason, you can use INSERT OVERWRITE :

  ALTER TABLE table1 ADD COLUMNS (column STRING); - Suppose you have not already made the column underlying surcharge table table 1 SELECT *, 'colval' table2;  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -