TInstance boolType = AkBool.INSTANCE.instance(false);
TPreparedExpression predicate = null;
for (int i = 0; i < plan.ncols; i++) {
Column referencingColumn = referencingColumns.get(i);
TPreparedField field = new TPreparedField(referencingColumn.getType(), referencingColumn.getPosition());
TPreparedExpression clause = new TPreparedFunction(isNull, boolType, Arrays.asList(field));
clause = new TPreparedFunction(not, boolType, Arrays.asList(clause));
if (predicate == null) {
predicate = clause;
}
else {
predicate = new TPreparedFunction(and, boolType, Arrays.asList(predicate, clause));
}
}
input = API.groupScan_Default(group);
input = API.filter_Default(input, Collections.singletonList(tableRowType));
input = API.select_HKeyOrdered(input, tableRowType, predicate);