[ https://issues.apache.org/jira/browse/HIVE-7680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14098954#comment-14098954 ]
Alexander Pivovarov commented on HIVE-7680: ------------------------------------------- Thejas Below are messages for create/insert/select/drop from SQL Workbench, SQuirreL SQL and DbVisualiser using fixed jdbc driver ( Fixed jdbc driver always returns: getUpdateCount=-1 getMoreResuls=false ================================ SQL Workbench build 116 ================================ create table aa5 (int id); Table 'aa5' created Execution time: 0.12s --------------------------------- insert into table aa5 select 1 from dual; INSERT INTO TABLE successful Execution time: 10.22s --------------------------------- select * from aa5; SELECT executed successfully Execution time: 0.13s --------------------------------- drop table aa5; Table 'aa5' dropped Execution time: 0.89s ================================= SQuirreL SQL 3.5.3 ================================= create table aa5 (int id); Query 1 of 1, Rows read: 0, Elapsed time (seconds) - Total: 0.077, SQL query: 0.077, Reading results: 0 insert into table aa5 select 1 from dual; Query 1 of 1, Rows read: 0, Elapsed time (seconds) - Total: 10.557, SQL query: 10.557, Reading results: 0 select * from aa5; Query 1 of 1, Rows read: 1, Elapsed time (seconds) - Total: 0.096, SQL query: 0.063, Reading results: 0.033 drop table aa5; Query 1 of 1, Rows read: 0, Elapsed time (seconds) - Total: 0.12, SQL query: 0.12, Reading results: 0 ================================ DbVisualizer 9.1.9 ================================ create table aa5 (int id); 11:42:41 [CREATE - 0 row(s), 0.091 secs] Command processed. No rows were affected ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.091/0.000 sec [0 successful, 1 warnings, 0 errors] insert into table aa5 select 1 from dual; 11:43:56 [INSERT - 0 row(s), 9.758 secs] Command processed. No rows were affected ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 9.758/0.000 sec [0 successful, 1 warnings, 0 errors] select * from aa5; 11:44:23 [SELECT - 1 row(s), 0.069 secs] Result set fetched ... 1 statement(s) executed, 1 row(s) affected, exec/fetch time: 0.069/0.029 sec [1 successful, 0 warnings, 0 errors] select * from aa5 where 1=0 11:57:12 [SELECT - 0 row(s), 10.022 secs] Empty result set fetched ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 10.022/0.009 sec [0 successful, 1 warnings, 0 errors] drop table aa5; 11:44:40 [DROP - 0 row(s), 0.095 secs] Command processed. No rows were affected ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.095/0.000 sec [0 successful, 1 warnings, 0 errors] Note: DbVisualizer always increase warnings counter on empty result (e.g. for select .. where 1=0), so it's ok that is shows "1 warnings" on create/insert/drop statements > Do not throw SQLException for HiveStatement getMoreResults and > setEscapeProcessing(false) > ----------------------------------------------------------------------------------------- > > Key: HIVE-7680 > URL: https://issues.apache.org/jira/browse/HIVE-7680 > Project: Hive > Issue Type: Bug > Components: JDBC > Affects Versions: 0.13.1 > Reporter: Alexander Pivovarov > Assignee: Alexander Pivovarov > Priority: Minor > Attachments: HIVE-7680.patch > > > 1. Some JDBC clients call method setEscapeProcessing(false) (e.g. SQL > Workbench) > Looks like setEscapeProcessing(false) should do nothing.So, lets do nothing > instead of throwing SQLException > 2. getMoreResults is needed in case Statements returns several ReseltSet. > Hive does not support Multiple ResultSets. So this method can safely always > return false. > 3. getUpdateCount. Currently this method always returns 0. Hive cannot tell > us how many rows were inserted. According to JDBC spec it should return " -1 > if the current result is a ResultSet object or there are no more results" > if this method returns 0 then in case of execution insert statement JDBC > client shows "0 rows were inserted" which is not true. > if this method returns -1 then JDBC client runs insert statements and shows > that it was executed successfully, no result were returned. > I think the latter behaviour is more correct. > 4. Some methods in Statement class should throw > SQLFeatureNotSupportedException if they are not supported. Current > implementation throws SQLException instead which means database access error. -- This message was sent by Atlassian JIRA (v6.2#6252)