Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Hive table

Status
Not open for further replies.

Soham1087

Banned
Joined
May 31, 2022
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
India
Activity points
185
So An empty Hive table is returned by Data Science Experience.
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!
 

So An empty Hive table is returned by Data Science Experience.
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!
Based on the provided code, it appears that the offers table in Hive is being read using a JDBC connection. However, the offers.count() and offers.show() methods return zero rows, indicating that the table is empty.

To further diagnose the issue, you may want to check if there are any issues with the JDBC connection or if the offers table has any data in it. You could try running a simple SQL query using the spark.sql() method to see if it returns any results.

Additionally, if you are interested in pursuing a career as an AWS developer, you may want to consider obtaining an AWS developer certification training. This certification can help you demonstrate your expertise in developing and maintaining applications on the AWS platform, which is a valuable skill in today's cloud-focused technology industry.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top