Member since
08-18-2017
71
Posts
10
Kudos Received
14
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
547 | 06-24-2019 01:56 PM | |
364 | 10-13-2018 04:40 AM | |
262 | 10-13-2018 04:24 AM | |
781 | 10-05-2018 02:59 PM | |
804 | 10-04-2018 09:06 AM |
02-27-2020
10:34 AM
hive -e "use default;set hive.cli.print.header=true;select * from hive_table;" | sed 's/[\t]/|/g' >/tmp/hive_table.txt
... View more
10-04-2018
05:24 PM
When applying order by twice, hive assumes column selection order is same on both inner & outer query which does order by on wrong column assuming wrong column datatype. You can rewrite your query having outer & inner query projection as same. SELECT t_6.color color, t_6.noq_empty noq_empty
FROM
(SELECT t_5.color_gbakc2 color,
t_5.noq_empty_gbakc3 noq_empty
FROM
(SELECT testtable.color_gbakc2 color_gbakc2,
testtable.noq_empty_gbakc3 noq_empty_gbakc3,
testtable.color_gbakc1 color_gbakc1
FROM testtable testtable
WHERE testtable.color_gbakc2 IN ('Red',
'Blue',
'Green') ) t_5
WHERE t_5.color_gbakc2 IN ('Red',
'Blue')
ORDER BY noq_empty ASC ) t_6
ORDER BY color Fortunately HIVE-6348 is a plan optimizer & its eliminating this issue also. If my answer helped you, accept the answer. It will help others in the community.
... View more