From f22d07dc486602f5ebb228a0e2142f048cca5039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kubik?= Date: Thu, 9 Jan 2025 17:12:49 +0100 Subject: [PATCH] add check for array type --- src/main/java/net/snowflake/client/core/SFArrowResultSet.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java index f539a03ee..2af122a89 100644 --- a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java +++ b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java @@ -597,9 +597,11 @@ private StructObjectWrapper getObjectRepresentation(int columnIndex, boolean wit if (type == Types.STRUCT) { JsonSqlInput jsonSqlInput = createJsonSqlInput(columnIndex, obj); return new StructObjectWrapper(jsonSqlInput.getText(), jsonSqlInput); - } else { + } else if (type == Types.ARRAY) { SfSqlArray sfArray = getJsonArray((String) obj, columnIndex); return new StructObjectWrapper(sfArray.getText(), sfArray); + } else { + throw new SFException(queryId, ErrorCode.INVALID_STRUCT_DATA); } } else if (converter instanceof StructConverter) { String jsonString = withString ? converter.toString(index) : null;