0

Using hive, I'm trying to concatenate columns from one table and insert them in another table using the query

insert into table temp_error 
select * from (Select 'temp_test','abcd','abcd','abcd',
from_unixtime(unix_timestamp()),concat_ws('|',sno,name,age)
from temp_test_string)c;

I get the required output till I use Select *. But as soon as I try to insert it into the table, it does not give concatenated output but gives the value of sno only instead of whole concatenated output.

StackUseR
  • 884
  • 1
  • 11
  • 40

1 Answers1

0

Thanks guys. I found why it was behaving that way. It's because while creating table I gave "separate fields by '|'". So what I was trying to insert as a string into the table, hive was interpreting it as different columns.