From 496f99ca0df8dc43bd356918d9cd9fc25298b7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kubik?= Date: Fri, 22 Nov 2024 15:17:22 +0100 Subject: [PATCH] rename obj to arrayString in getJsonArray --- .../client/core/SFBaseResultSet.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java index e13ceb2fb..c0b6256ad 100644 --- a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java +++ b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java @@ -273,7 +273,7 @@ protected SQLInput createJsonSqlInputForColumn( } @SnowflakeJdbcInternalApi - protected SfSqlArray getJsonArray(String obj, int columnIndex) throws SFException { + protected SfSqlArray getJsonArray(String arrayString, int columnIndex) throws SFException { try { List fieldMetadataList = resultSetMetaData.getColumnFields(columnIndex); if (fieldMetadataList.size() != 1) { @@ -288,38 +288,38 @@ protected SfSqlArray getJsonArray(String obj, int columnIndex) throws SFExceptio int columnType = ColumnTypeHelper.getColumnType(columnSubType, session); int scale = fieldMetadata.getScale(); - ArrayNode arrayNode = (ArrayNode) OBJECT_MAPPER.readTree(obj); + ArrayNode arrayNode = (ArrayNode) OBJECT_MAPPER.readTree(arrayString); Iterator nodeElements = arrayNode.elements(); switch (columnType) { case Types.INTEGER: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().integerConverter(columnType)) .toArray(Integer[]::new)); case Types.SMALLINT: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().smallIntConverter(columnType)) .toArray(Short[]::new)); case Types.TINYINT: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().tinyIntConverter(columnType)) .toArray(Byte[]::new)); case Types.BIGINT: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().bigIntConverter(columnType)) .toArray(Long[]::new)); case Types.DECIMAL: case Types.NUMERIC: return new SfSqlArray( - obj, + arrayString, columnSubType, convertToFixedArray( getStream(nodeElements, getConverters().bigDecimalConverter(columnType)))); @@ -327,7 +327,7 @@ protected SfSqlArray getJsonArray(String obj, int columnIndex) throws SFExceptio case Types.VARCHAR: case Types.LONGNVARCHAR: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream( nodeElements, @@ -335,38 +335,38 @@ protected SfSqlArray getJsonArray(String obj, int columnIndex) throws SFExceptio .toArray(String[]::new)); case Types.BINARY: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().bytesConverter(columnType, scale)) .toArray(Byte[][]::new)); case Types.FLOAT: case Types.REAL: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().floatConverter(columnType)) .toArray(Float[]::new)); case Types.DOUBLE: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().doubleConverter(columnType)) .toArray(Double[]::new)); case Types.DATE: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().dateStringConverter(session)) .toArray(Date[]::new)); case Types.TIME: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().timeFromStringConverter(session)) .toArray(Time[]::new)); case Types.TIMESTAMP: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream( nodeElements, @@ -376,19 +376,19 @@ protected SfSqlArray getJsonArray(String obj, int columnIndex) throws SFExceptio .toArray(Timestamp[]::new)); case Types.BOOLEAN: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().booleanConverter(columnType)) .toArray(Boolean[]::new)); case Types.STRUCT: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().structConverter(OBJECT_MAPPER)) .toArray(Map[]::new)); case Types.ARRAY: return new SfSqlArray( - obj, + arrayString, columnSubType, getStream(nodeElements, getConverters().arrayConverter(OBJECT_MAPPER)) .toArray(Map[][]::new));