Index: jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java =================================================================== --- jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java (revision 1496243) +++ jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java (working copy) @@ -478,6 +478,12 @@ assertEquals(true, res.getBoolean(1)); assertEquals(true, res.getBoolean(4)); + // test case sensitivity + assertFalse(meta.isCaseSensitive(1)); + assertFalse(meta.isCaseSensitive(2)); + assertFalse(meta.isCaseSensitive(3)); + assertTrue(meta.isCaseSensitive(4)); + // no more rows assertFalse(res.next()); } Index: jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java =================================================================== --- jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java (revision 1496243) +++ jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java (working copy) @@ -82,15 +82,8 @@ } public String getColumnTypeName(int column) throws SQLException { - if (columnTypes == null) { - throw new SQLException( - "Could not determine column type name for ResultSet"); - } + validateColumnType(column); - if (column < 1 || column > columnTypes.size()) { - throw new SQLException("Invalid column value: " + column); - } - // we need to convert the Hive type to the SQL type name // TODO: this would be better handled in an enum String type = columnTypes.get(column - 1); @@ -155,7 +148,17 @@ } public boolean isCaseSensitive(int column) throws SQLException { - throw new SQLException("Method not supported"); + validateColumnType(column); + + // we need to convert the Hive type to the SQL type name + // TODO: this would be better handled in an enum + String type = columnTypes.get(column - 1); + + if("string".equalsIgnoreCase(type)) { + return true; + } else { + return false; + } } public boolean isCurrency(int column) throws SQLException { @@ -196,4 +199,14 @@ throw new SQLException("Method not supported"); } + protected void validateColumnType(int column) throws SQLException { + if (columnTypes == null) { + throw new SQLException( + "Could not determine column type name for ResultSet"); + } + + if (column < 1 || column > columnTypes.size()) { + throw new SQLException("Invalid column value: " + column); + } + } }