08-14-2017 02:01 AM - edited 08-14-2017 05:18 AM
I am using CDH hive driver to send data to hadoop. I am using executeUpdate() and expecting that it would return the number of rows. However, it always returns 0.
1. Is there some setting to be modified in hive-site.xml to support this?
2. If this functionality is not supported in CDH, what is the recommended way of getting the updated row count? Or is there a way to get the status message or something which would convey more details about what transpired during the executeUpdate() call?
08-22-2017 03:06 AM
Thanks for the reply.
I am using a DML statement.
Here is the sample code:
final StringBuffer sql = new StringBuffer( "INSERT INTO TABLE empData VALUES (1, 'John Doe'); " );
pstmt = con.prepareStatement( sql.toString() );
int result = pstmt.executeUpdate ( );
Here, the result variable always gets the value 0.
08-28-2017 02:05 AM
did you try to do a select statement in the empData to see if the insert is successful after executing your code
if it return zero it clearly states that it has no done nothing .