Skip to content

Commit

Permalink
Support json type in PinotSegmentPageSource
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangfu0 authored and highker committed Feb 18, 2022
1 parent 4d8aad1 commit 6b5da9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ private Slice getSlice(int rowIndex, int columnIndex)
String[] stringArray = currentDataTable.getDataTable().getStringArray(rowIndex, columnIndex);
return utf8Slice(Arrays.toString(stringArray));
case STRING:
case JSON:
String field = currentDataTable.getDataTable().getString(rowIndex, columnIndex);
if (field == null || field.isEmpty()) {
return Slices.EMPTY_SLICE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.facebook.airlift.log.Logger;
import com.facebook.presto.common.type.BigintType;
import com.facebook.presto.common.type.FixedWidthType;
import com.facebook.presto.common.type.JsonType;
import com.facebook.presto.common.type.TypeManager;
import com.facebook.presto.common.type.VarcharType;
import com.facebook.presto.pinot.PinotColumnHandle;
Expand Down Expand Up @@ -499,7 +500,7 @@ public PinotQueryGeneratorContext visitAggregation(AggregationNode node, PinotQu
case GROUP_BY: {
GroupByColumnNode groupByColumn = (GroupByColumnNode) expression;
VariableReferenceExpression groupByInputColumn = getVariableReference(groupByColumn.getInputColumn());
checkState(groupByInputColumn.getType() instanceof FixedWidthType || groupByInputColumn.getType() instanceof VarcharType);
checkState(groupByInputColumn.getType() instanceof FixedWidthType || groupByInputColumn.getType() instanceof VarcharType || groupByInputColumn.getType() instanceof JsonType);
variablesInAggregation.add(groupByInputColumn);
break;
}
Expand Down

0 comments on commit 6b5da9a

Please sign in to comment.