Skip to content

Commit

Permalink
HIVE-28358: Enable JDBC getClob retrieval from String columns
Browse files Browse the repository at this point in the history
  • Loading branch information
vpinna80 committed Jul 2, 2024
1 parent fe2e17c commit 857b96a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
import java.util.List;
import java.util.Map;

import javax.sql.rowset.serial.SerialClob;

import org.apache.hadoop.hive.common.type.HiveIntervalDayTime;
import org.apache.hadoop.hive.common.type.HiveIntervalYearMonth;
import org.apache.hadoop.hive.common.type.TimestampTZUtil;
Expand Down Expand Up @@ -309,12 +311,14 @@ public Reader getCharacterStream(String columnName) throws SQLException {

@Override
public Clob getClob(int i) throws SQLException {
throw new SQLFeatureNotSupportedException("Method not supported");
String str = getString(i);
return new SerialClob(str == null ? new char[0] : str.toCharArray());
}

@Override
public Clob getClob(String colName) throws SQLException {
throw new SQLFeatureNotSupportedException("Method not supported");
String str = getString(colName);
return new SerialClob(str == null ? new char[0] : str.toCharArray());
}

@Override
Expand Down

0 comments on commit 857b96a

Please sign in to comment.