Skip to content

Commit

Permalink
fix for structured types strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pmotacki committed Dec 10, 2024
1 parent 50c273f commit cc0e6c7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ public Object getObject(int columnIndex) throws SFException {

@SnowflakeJdbcInternalApi
@Override
public Object getObject(int columnIndex, Class<?> type) throws SFException {
public Object getObjectWithoutString(int columnIndex) throws SFException {
return getObjectRepresentation(columnIndex, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public abstract class SFBaseResultSet {
public abstract Object getObject(int columnIndex) throws SFException;

@SnowflakeJdbcInternalApi
public abstract Object getObject(int columnIndex, Class<?> type) throws SFException;
public abstract Object getObjectWithoutString(int columnIndex) throws SFException;

public Array getArray(int columnIndex) throws SFException {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Object getObject(int columnIndex) throws SFException {

@SnowflakeJdbcInternalApi
@Override
public Object getObject(int columnIndex, Class<?> type) throws SFException {
public Object getObjectWithoutString(int columnIndex) throws SFException {
return getObject(columnIndex);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
SnowflakeUtil.mapSFExceptionToSQLException(
() -> {
StructObjectWrapper structObjectWrapper =
(StructObjectWrapper) sfBaseResultSet.getObject(columnIndex);
(StructObjectWrapper) sfBaseResultSet.getObjectWithoutString(columnIndex);
if (structObjectWrapper == null) {
return null;
}
Expand Down Expand Up @@ -1642,7 +1642,7 @@ public <T> Map<String, T> getMap(int columnIndex, Class<T> type) throws SQLExcep
StructObjectWrapper structObjectWrapper =
(StructObjectWrapper)
SnowflakeUtil.mapSFExceptionToSQLException(
() -> sfBaseResultSet.getObject(columnIndex, type));
() -> sfBaseResultSet.getObjectWithoutString(columnIndex));
if (structObjectWrapper == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ public void testReturnAsArrayOfNullableFieldsInSqlData(ResultSetFormatType forma
(resultSet) -> {
NullableFieldsSqlData result =
resultSet
.unwrap(SnowflakeBaseResultSet.class)
.getObject(1, NullableFieldsSqlData.class);
assertNull(result.getString());
assertNull(result.getNullableIntValue());
Expand Down

0 comments on commit cc0e6c7

Please sign in to comment.