fx19880617 commented on a change in pull request #6581: URL: https://github.com/apache/incubator-pinot/pull/6581#discussion_r576652602
########## File path: pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/PinotResultSet.java ########## @@ -297,6 +299,54 @@ public String getString(int columnIndex) return val; } + @Override + public Object getObject(int columnIndex) + throws SQLException { + + String dataType = _columnDataTypes.getOrDefault(columnIndex, ""); + + if (dataType.isEmpty()) { + throw new SQLDataException("Data type not supported for " + dataType); + } + + switch (dataType) { + case "STRING": + return getString(columnIndex); + case "INT": + return getInt(columnIndex); + case "LONG": + return getLong(columnIndex); + case "FLOAT": + return getFloat(columnIndex); + case "DOUBLE": + return getDouble(columnIndex); + case "BOOLEAN": + return getBoolean(columnIndex); + case "BYTES": + return getBytes(columnIndex); + default: + throw new SQLDataException("Data type not supported for " + dataType); + } + } + + @Override + public <T> T getObject(int columnIndex, Class<T> type) Review comment: Can you write a test for this? Wanna check if the type cast works ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org