hive queries with staging table.