use of org.apache.druid.segment.column.RowSignature in project druid by druid-io.
the class RowSignatures method fromRelDataType.
public static RowSignature fromRelDataType(final List<String> rowOrder, final RelDataType rowType) {
if (rowOrder.size() != rowType.getFieldCount()) {
throw new IAE("Field count %d != %d", rowOrder.size(), rowType.getFieldCount());
}
final RowSignature.Builder rowSignatureBuilder = RowSignature.builder();
for (int i = 0; i < rowOrder.size(); i++) {
final RelDataType dataType = rowType.getFieldList().get(i).getType();
final ColumnType valueType = Calcites.getColumnTypeForRelDataType(dataType);
rowSignatureBuilder.add(rowOrder.get(i), valueType);
}
return rowSignatureBuilder.build();
}
Aggregations