use of org.apache.drill.exec.store.easy.json.parser.ValueParser in project drill by apache.
the class ExtendedTypeFieldFactory method arrayParserFor.
private ElementParser arrayParserFor(FieldDefn fieldDefn) {
TokenIterator tokenizer = fieldDefn.tokenizer();
JsonToken token = tokenizer.requireNext();
if (token != JsonToken.START_OBJECT) {
tokenizer.unget(token);
return null;
}
ValueParser element = extendedTypeParserFor(fieldDefn, true);
tokenizer.unget(token);
if (element == null) {
return null;
}
return scalarArrayParserFor(element);
}
use of org.apache.drill.exec.store.easy.json.parser.ValueParser in project drill by apache.
the class ProvidedFieldFactory method basicParserFor.
private ElementParser basicParserFor(FieldDefn fieldDefn) {
// Delegate parser creation downward: will be done by the extended
// types factory, if present, else by inferred field factory.
ColumnMetadata colSchema = fieldDefn.providedColumn().copy();
ValueParser scalarParser = child.scalarParserFor(fieldDefn, colSchema);
if (colSchema.isArray()) {
return scalarArrayParserFor(scalarParser);
} else {
return scalarParser;
}
}
Aggregations