[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159274#comment-14159274 ] Lefty Leverenz commented on HIVE-8330: -- Does this need any user documentation? How about a release note, at least? HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Fix For: 0.15.0 Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch, HIVE-8330.3.patch, HIVE-8330.4.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159311#comment-14159311 ] Brock Noland commented on HIVE-8330: I think think this was just a plain old bug but a release note is probably useful since many folks are likely working around this. HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Fix For: 0.15.0 Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch, HIVE-8330.3.patch, HIVE-8330.4.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159356#comment-14159356 ] Lefty Leverenz commented on HIVE-8330: -- Thanks, [~brocknoland]! HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Fix For: 0.15.0 Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch, HIVE-8330.3.patch, HIVE-8330.4.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14158171#comment-14158171 ] Brock Noland commented on HIVE-8330: This looks great! Just one minor issue and I am +1 pending tests. This does not log the stack trace: {noformat} String msg = Unexpected exception: + e; LOG.info(msg); {noformat} we should change it to: {noformat} String msg = Unexpected exception: + e; LOG.info(msg, e); {noformat} HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch, HIVE-8330.3.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14158702#comment-14158702 ] Hive QA commented on HIVE-8330: --- {color:green}Overall{color}: +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12672786/HIVE-8330.4.patch {color:green}SUCCESS:{color} +1 6538 tests passed Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/1107/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/1107/console Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-1107/ Messages: {noformat} Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase {noformat} This message is automatically generated. ATTACHMENT ID: 12672786 HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch, HIVE-8330.3.patch, HIVE-8330.4.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157160#comment-14157160 ] Brock Noland commented on HIVE-8330: Hi [~spena], Thank you for jumping on this!! I think it's possible for the members of columnNames to be any case. Assuming that is true, then I think that in the constructor of HiveBaseResultSet we'll have to copy the strings to a new list normalizedColumnNames as lower case. Then we use that list to check for existence in that list. The reason I think we should have a separate list is in HiveResultSetMetaData we actually return the name of the column to the user and we should be consistent with whatever case were returning previously... Thank you!! Brock HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Attachments: HIVE-8330.1.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157382#comment-14157382 ] Sergio Peña commented on HIVE-8330: --- Thanks [~brocknoland]. There are some metadata column names that are upper case. Patch available now. HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive
[ https://issues.apache.org/jira/browse/HIVE-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157523#comment-14157523 ] Hive QA commented on HIVE-8330: --- {color:red}Overall{color}: -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12672682/HIVE-8330.2.patch {color:red}ERROR:{color} -1 due to 15 failed/errored test(s), 6540 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.ql.txn.compactor.TestCompactor.testStatsAfterCompactionPartTbl org.apache.hive.hcatalog.pig.TestHCatLoader.testColumnarStorePushdown[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testConvertBooleanToInt[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testGetInputBytes[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testProjectionsBasic[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testReadDataBasic[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testReadDataPrimitiveTypes[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testReadPartitionedBasic[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testSchemaLoadBasic[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testSchemaLoadComplex[5] org.apache.hive.hcatalog.pig.TestHCatLoader.testSchemaLoadPrimitiveTypes[5] org.apache.hive.hcatalog.pig.TestHCatStorer.testDynamicPartitioningMultiPartColsNoDataInDataNoSpec[5] org.apache.hive.hcatalog.pig.TestHCatStorer.testEmptyStore[5] org.apache.hive.hcatalog.pig.TestHCatStorer.testNoAlias[5] org.apache.hive.hcatalog.pig.TestHCatStorer.testPartitionPublish[5] {noformat} Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/1091/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/1091/console Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-1091/ Messages: {noformat} Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 15 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12672682 HiveResultSet.findColumn() parameters are case sensitive Key: HIVE-8330 URL: https://issues.apache.org/jira/browse/HIVE-8330 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch Look at the following code: {noformat} Class.forName(org.apache.hive.jdbc.HiveDriver); Connection db = null; Statement stmt = null; ResultSet rs = null; try { db = DriverManager.getConnection(jdbc:hive2://localhost:1/default, hive, ); stmt = db.createStatement(); rs = stmt.executeQuery(SELECT * FROM sample_07 limit 1); ResultSetMetaData metaData = rs.getMetaData(); for (int i = 1; i = metaData.getColumnCount(); i++) { System.out.println(Column + i + : + metaData.getColumnName(i)); } while (rs.next()) { System.out.println(rs.findColumn(code)); } } finally { DbUtils.closeQuietly(db, stmt, rs); } {noformat} Above program will generate following result on my cluster: {noformat} Column 1: code Column 2: description Column 3: total_emp Column 4: salary 1 {noformat} However, if the last print sentence is changed as following (using uppercase characters): {noformat} System.out.println(rs.findColumn(Code)); {noformat} The program will fail at exactly that line. The same happens if the column name is changed as CODE Based on the JDBC ResultSet documentation, this method should be case insensitive. Column names used as input to getter methods are case insensitive http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)