Hive Queries- Sort by, Order by, Cluster by, and Distribute By

In Hive queries, we can use Sort by, Order by, Cluster by, and Distribute by to manage the ordering and distribution of the output of a SELECT query. We will see this with an example. We have a table Employee in Hive, partitioned by Department. 0: jdbc:hive2://localhost:10000> desc employee; +————————–+———————–+———————–+–+…

Continue reading

Java Code for Running HIVE queries through JDBC

In this article we will see how to run Hive queries through JDBC. We are using apache-hive-1.0.1 and hiveserver2 is running on port 10000 on localhost. Jars Required To access Hive through JDBC we need to add the following jars in the classpath:- guava-18.0.jar hive-common-1.0.0.jar hive-exec-0.13.0.jar hive-jdbc-1.0.0.jar hive-metastore-1.0.0.jar hive-serde-1.0.0.jar hive-service-1.0.0.jar…

Continue reading