L6H_Processing Data using Impala
L6H_Processing Data using Impala
Scenario 1 You are interested in knowing the number of orders and group by order dates.
https://stackoverflow.com/questions/3841295/sql-using-alias-in-group-by
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+GroupBy
data Note:
understanding • Make sure you already have this table (not a partitioned table).
• If the table is already in your Hive metastore, but it is not appeared in your
impala, then perform invalidate command.
• If the table is not yet in your Hive metastore, then you will need to sqoop from
MariaDB to Hive metastore. After that, perform invalidate command.
Scenario 2 This time, you are interested in knowing the number of orders and group by
order years.
Scenario 3 • We are interested in knowing the number of orders group by order years using
alias through subqueries technique.
Subqueries https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SubQueries#
:~:text=Subqueries%20in%20the%20FROM%20Clause,-
%3F&text=Hive%20supports%20subqueries%20only%20in,list%20must%20hav
e%20unique%20names.
Note:
• if the required table is not listed yet (e.g. customers table) but it is already in Hive
metastore, then run the following:
o invalidate metadata customers;