return row(rowType, fields);
}
public Row row(RowType rowType, Object... fields) {
if(fields.length < rowType.nFields()) {
QueryContext context = new SimpleQueryContext(newStoreAdapter(rowType.schema()));
List<TPreparedExpression> expressions = new ArrayList<>();
for(int i = 0; i < fields.length; ++i) {
TInstance type = rowType.typeAt(i);
TPreptimeValue val = ValueSources.fromObject(fields[i], type);
expressions.add(new TPreparedLiteral(type, val.value()));
}
for(int i = fields.length; i < rowType.nFields(); ++i) {
Column col = getColumn(rowType, i);
if(col == null) {
throw new IllegalArgumentException("Column " + i + "not specified and no default: " + rowType);
}
expressions.add(PlanGenerator.generateDefaultExpression(col, null, typesRegistryService(), ddl().getTypesTranslator(), context));
}
return new ExpressionRow(rowType, context, context.createBindings(), expressions);
} else {
return new TestRow(rowType, fields);
}
}