Query builder for Hive