use of com.epam.parso.SasFileProperties in project drill by apache.
the class SasBatchReader method addImplicitColumnsToSchema.
private TupleMetadata addImplicitColumnsToSchema(TupleMetadata schema) {
SchemaBuilder builder = new SchemaBuilder();
ColumnMetadata colSchema;
builder.addAll(schema);
SasFileProperties fileProperties = sasFileReader.getSasFileProperties();
// Add String Metadata columns
for (IMPLICIT_STRING_COLUMN name : IMPLICIT_STRING_COLUMN.values()) {
colSchema = MetadataUtils.newScalar(name.getFieldName(), MinorType.VARCHAR, DataMode.OPTIONAL);
colSchema.setBooleanProperty(ColumnMetadata.EXCLUDE_FROM_WILDCARD, true);
builder.add(colSchema);
}
// Add Date Column Names
for (IMPLICIT_DATE_COLUMN name : IMPLICIT_DATE_COLUMN.values()) {
colSchema = MetadataUtils.newScalar(name.getFieldName(), MinorType.DATE, DataMode.OPTIONAL);
colSchema.setBooleanProperty(ColumnMetadata.EXCLUDE_FROM_WILDCARD, true);
builder.add(colSchema);
}
populateMetadata(fileProperties);
return builder.build();
}
Aggregations