A couple of minor improvemets

Use $USER instead of username to make script.sh portable.

Added a query with explicit ORDER BY for Impala to show the same results as the Hive query. Hive does an implicit sort because of MR.