I am trying to connect to a remote hive thrift server using cloudera hive driver: com.cloudera.hive.jdbc4.HS2Driver. I am able to connect to it but while running any sql query I am not getting data in result, but only column names. The code which I am using is:
df = spark.read \
.format("jdbc") \
.option("driver", "com.cloudera.hive.jdbc4.HS2Driver") \
.option("url", "jdbc:hive2://host:port") \
.option("dbtable", db_name.table_name) \
.option("user", usr) \
.option("password", pwd) \
.option("properties",{"UseNativeQuery": 1}) \
.load()
df.show()
I know from logs that it is transforming queries and adding a condition where 1=0
. I think it is because of that. But i am not able to remove that.
How do i resolve this?