use of org.apache.calcite.adapter.enumerable.JavaRowFormat in project Mycat2 by MyCATApache.
the class MycatView method toRows.
public static Expression toRows(PhysType physType, Expression expression, final int fieldCount) {
JavaRowFormat oldFormat = JavaRowFormat.ARRAY;
if (physType.getFormat() == oldFormat) {
return expression;
}
final ParameterExpression row_ = Expressions.parameter(Object[].class, "row");
List<Expression> expressionList = new ArrayList<>(fieldCount);
for (int i = 0; i < fieldCount; i++) {
expressionList.add(fieldExpression(row_, i, physType, oldFormat));
}
return Expressions.call(expression, BuiltInMethod.SELECT.method, Expressions.lambda(Function1.class, physType.record(expressionList), row_));
}
Aggregations