I am trying to run the query in Hive
select concat(col1 , "\t", col2 ) from table1 order by col2, col1
but it gives following error:
Error while compiling statement: FAILED: SemanticException [Error 10004]: line 1:60 Invalid table alias or column reference 'col2': (possible column names are: _c0)
If I run
select col1 ,col2 from table1 order by col2, col1
it works fine but i need to output with tab delimiter (and sorted first by col2)
Any hint on how can I make the query run?
Thanks in advance
Hi @omrubi .
Please try like below(just replace here deli.):-
This is final solution in working Mode:-
SELECT CONCAT(CONCAT("(", CONCAT_WS("\t", col1, col2)), ")") as col3