Skip to content

Commit

Permalink
Fixed issue with deserializing lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenstott committed Oct 22, 2024
1 parent 28a381b commit 1ef7111
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions calcite-rs-jni/jni/src/main/java/com/hasura/CalciteQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.opentelemetry.context.Context;
import org.apache.calcite.adapter.jdbc.JdbcSchema;
import org.apache.calcite.adapter.jdbc.JdbcTable;
import org.apache.calcite.avatica.util.ArrayImpl;
import org.apache.calcite.jdbc.CalciteConnection;
import org.apache.calcite.jdbc.CalciteSchema;
import org.apache.calcite.schema.Schema;
Expand Down Expand Up @@ -291,6 +292,8 @@ private Map<String, ColumnMetadata> getTableColumnInfo(TableMetadata table) {
remapTypes.put("JavaType(class java.lang.Integer)", "INTEGER");
remapTypes.put("INTEGER NOT NULL", "INTEGER");
remapTypes.put("INTEGER", "INTEGER");
remapTypes.put("MAP NOT NULL", "MAP");
remapTypes.put("ARRAY NOT NULL", "ARRAY");
remapTypes.put("JSON", "JSON");
remapTypes.put("JSONB", "JSON");
remapTypes.put("SMALLINT NOT NULL", "INTEGER");
Expand Down Expand Up @@ -478,6 +481,8 @@ public String queryModels(String query, String parentTraceId, String parentSpanI
java.util.Date utilDate = new java.util.Date(sqlTimestamp.getTime());
String rfcDateString = rfcFormat.format(utilDate.toInstant());
columns.put(metaData.getColumnLabel(i), rfcDateString);
} else if (value instanceof ArrayImpl) {
columns.put(metaData.getColumnLabel(i), ((ArrayImpl) value).getArray());
}
// if it is not date - put the value directly
else {
Expand Down

0 comments on commit 1ef7111

Please sign in to comment.