Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/ai/chalk/client/ChalkClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ private OnlineQueryResult onlineQueryJson(OnlineQueryParamsComplete params) thro
var dataItem = (Map<String, Object>) item;
String fieldName = (String) dataItem.get("field");
Object value = dataItem.get("value");
if (fieldName == null) continue;
if (fieldName == null || value == null) continue;

FieldVector vector = createVectorForValue(fieldName, value, childAllocator);
if (vector != null) vectors.add(vector);
}
scalarTable = new Table(vectors);
if (!vectors.isEmpty()) {
scalarTable = new Table(vectors);
}
} catch (Exception e) {
for (FieldVector v : vectors) v.close();
childAllocator.close();
Expand All @@ -179,9 +181,7 @@ private OnlineQueryResult onlineQueryJson(OnlineQueryParamsComplete params) thro
}

private static FieldVector createVectorForValue(String name, Object value, BufferAllocator allocator) {
if (value == null) {
return new NullVector(name, 1);
} else if (value instanceof Integer intVal) {
if (value instanceof Integer intVal) {
BigIntVector v = new BigIntVector(name, allocator);
v.allocateNew(1);
v.set(0, intVal.longValue());
Expand Down
Loading