use of com.thinkbiganalytics.discovery.rest.controller.SchemaParserAnnotationTransformer in project kylo by Teradata.
the class FileParserFactory method getSparkSchemaParserDescriptors.
/**
* Returns the list of Schema Parsers transformed for the UI that support Spark
* @return
*/
public List<SchemaParserDescriptor> getSparkSchemaParserDescriptors() {
List<FileSchemaParser> parsers = FileParserFactory.instance().listSchemaParsers();
SchemaParserAnnotationTransformer transformer = new SchemaParserAnnotationTransformer();
List<SchemaParserDescriptor> list = parsers.stream().map(parser -> transformer.toUIModel(parser)).sorted(SchemaParserDescriptorUtil.compareByNameThenSpark()).collect(Collectors.toList());
list = SchemaParserDescriptorUtil.keepFirstByName(list);
return list;
}
use of com.thinkbiganalytics.discovery.rest.controller.SchemaParserAnnotationTransformer in project kylo by Teradata.
the class FileMetadataResultModifier method fileSchemaParser.
private Optional<FileSchemaParser> fileSchemaParser(SchemaParserDescriptor descriptor) {
try {
SchemaParserAnnotationTransformer transformer = new SchemaParserAnnotationTransformer();
FileSchemaParser p = transformer.fromUiModel(descriptor);
if (p instanceof SparkFileSchemaParser) {
SparkFileSchemaParser sparkFileSchemaParser = (SparkFileSchemaParser) p;
sparkFileSchemaParser.setDataFrameVariable("df");
sparkFileSchemaParser.setLimit(-1);
}
return Optional.of(p);
} catch (Exception e) {
return Optional.empty();
}
}
use of com.thinkbiganalytics.discovery.rest.controller.SchemaParserAnnotationTransformer in project kylo by Teradata.
the class FileMetadataTransformResponseModifier method fileSchemaParser.
private Optional<FileSchemaParser> fileSchemaParser(SchemaParserDescriptor descriptor) {
try {
SchemaParserAnnotationTransformer transformer = new SchemaParserAnnotationTransformer();
FileSchemaParser p = transformer.fromUiModel(descriptor);
if (p instanceof SparkFileSchemaParser) {
SparkFileSchemaParser sparkFileSchemaParser = (SparkFileSchemaParser) p;
sparkFileSchemaParser.setDataFrameVariable("df");
sparkFileSchemaParser.setLimit(-1);
}
return Optional.of(p);
} catch (Exception e) {
return Optional.empty();
}
}
Aggregations