Skip to content

Commit 1ef7111

Browse files
committed
Fixed issue with deserializing lists.
1 parent 28a381b commit 1ef7111

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

calcite-rs-jni/jni/src/main/java/com/hasura/CalciteQuery.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io.opentelemetry.context.Context;
88
import org.apache.calcite.adapter.jdbc.JdbcSchema;
99
import org.apache.calcite.adapter.jdbc.JdbcTable;
10+
import org.apache.calcite.avatica.util.ArrayImpl;
1011
import org.apache.calcite.jdbc.CalciteConnection;
1112
import org.apache.calcite.jdbc.CalciteSchema;
1213
import org.apache.calcite.schema.Schema;
@@ -291,6 +292,8 @@ private Map<String, ColumnMetadata> getTableColumnInfo(TableMetadata table) {
291292
remapTypes.put("JavaType(class java.lang.Integer)", "INTEGER");
292293
remapTypes.put("INTEGER NOT NULL", "INTEGER");
293294
remapTypes.put("INTEGER", "INTEGER");
295+
remapTypes.put("MAP NOT NULL", "MAP");
296+
remapTypes.put("ARRAY NOT NULL", "ARRAY");
294297
remapTypes.put("JSON", "JSON");
295298
remapTypes.put("JSONB", "JSON");
296299
remapTypes.put("SMALLINT NOT NULL", "INTEGER");
@@ -478,6 +481,8 @@ public String queryModels(String query, String parentTraceId, String parentSpanI
478481
java.util.Date utilDate = new java.util.Date(sqlTimestamp.getTime());
479482
String rfcDateString = rfcFormat.format(utilDate.toInstant());
480483
columns.put(metaData.getColumnLabel(i), rfcDateString);
484+
} else if (value instanceof ArrayImpl) {
485+
columns.put(metaData.getColumnLabel(i), ((ArrayImpl) value).getArray());
481486
}
482487
// if it is not date - put the value directly
483488
else {

0 commit comments

Comments
 (0)