use of org.apache.samza.sql.dsl.SamzaSqlDslConverter in project samza by apache.
the class SamzaExecutor method generateResultSchema.
SqlSchema generateResultSchema(Config config) {
SamzaSqlDslConverter converter = (SamzaSqlDslConverter) new SamzaSqlDslConverterFactory().create(config);
RelRoot relRoot = converter.convertDsl("").iterator().next();
List<String> colNames = new ArrayList<>();
List<String> colTypeNames = new ArrayList<>();
for (RelDataTypeField dataTypeField : relRoot.validatedRowType.getFieldList()) {
colNames.add(dataTypeField.getName());
colTypeNames.add(dataTypeField.getType().toString());
}
// in QueryResult class and executeQuery().
return new SqlSchema(colNames, Collections.emptyList());
}
Aggregations