Linked Questions

Popular Questions

Hive order by not visible column

Asked by At

Let's say I have table test with column a,b and c and test2 with same column. Can I create a view of table test and test 2 joined together and ordered by field c from table test without showing it in final output? In my case:

CREATE VIEW AS test_view AS
SELECT a,b FROM (SELECT * FROM test ORDER BY c)
JOIN test2 ON test.a =test2.a;

Ok I test it and it is not possible because shuffle phase so maybe there is another solution to somehow do it? Table are too big to do broadcast join.

Of course I can do

CREATE VIEW AS test_view AS
SELECT a,b,c FROM test
JOIN test2 ON test.a =test2.a
ORDER BY c

and then

CREATE VIEW AS final_view AS
SELECT a,b FROM test_view;

But this solution is very not optimal

Any idea?

Related Questions