Soham1087
Newbie level 4

So An empty Hive table is returned by Data Science Experience.
here is the code:
Based on my Data Science experience, I can connect to the Hive database in BigInsights and read the table schema by following the instructions in this post. However, Data Science Experience does not appear to be capable of reading the table contents, since I receive a count of zero!
here is the code:
Code:
conf = (SparkConf().set("com.ibm.analytics.metadata.enabled","false"))
spark = SparkSession.builder.enableHiveSupport().getOrCreate()
dash = {
'jdbcurl': 'jdbc:hive2://nnnnnnnnnnn:10000/;ssl=true;',
'user': 'xxxxxxxxxx',
'password': 'xxxxxxxxx',
}
spark.conf
offers = spark.read.jdbc(dash['jdbcurl'],
table='offers',
properties={"user" : dash["user"],
"password" : dash["password"]})
offers.count() returns: 0
offers.show()
returns:
+-----------+----------+
|offers.name|offers.age|
+-----------+----------+
+-----------+----------+
Based on my Data Science experience, I can connect to the Hive database in BigInsights and read the table schema by following the instructions in this post. However, Data Science Experience does not appear to be capable of reading the table contents, since I receive a count of zero!