Search in sources :

Example 1 with ArrayColumnConverter

use of org.apache.drill.exec.record.ColumnConverter.ArrayColumnConverter in project drill by apache.

the class ColumnConverterFactory method getArrayConverter.

private ColumnConverter getArrayConverter(TupleMetadata providedSchema, ColumnMetadata readerSchema, ArrayWriter arrayWriter) {
    ObjectWriter valueWriter = arrayWriter.entry();
    ColumnConverter valueConverter;
    if (readerSchema.isMap()) {
        valueConverter = getMapConverter(providedSchema, readerSchema.tupleSchema(), valueWriter.tuple());
    } else if (readerSchema.isDict()) {
        valueConverter = getDictConverter(providedSchema, readerSchema.tupleSchema(), valueWriter.dict());
    } else if (readerSchema.isMultiList()) {
        valueConverter = getConverter(null, readerSchema.childSchema(), valueWriter);
    } else {
        valueConverter = getScalarConverter(readerSchema, valueWriter.scalar());
    }
    return new ArrayColumnConverter(arrayWriter, valueConverter);
}
Also used : ArrayColumnConverter(org.apache.drill.exec.record.ColumnConverter.ArrayColumnConverter) ObjectWriter(org.apache.drill.exec.vector.accessor.ObjectWriter) ScalarColumnConverter(org.apache.drill.exec.record.ColumnConverter.ScalarColumnConverter) DummyColumnConverter(org.apache.drill.exec.record.ColumnConverter.DummyColumnConverter) DictColumnConverter(org.apache.drill.exec.record.ColumnConverter.DictColumnConverter) MapColumnConverter(org.apache.drill.exec.record.ColumnConverter.MapColumnConverter) ArrayColumnConverter(org.apache.drill.exec.record.ColumnConverter.ArrayColumnConverter)

Aggregations

ArrayColumnConverter (org.apache.drill.exec.record.ColumnConverter.ArrayColumnConverter)1 DictColumnConverter (org.apache.drill.exec.record.ColumnConverter.DictColumnConverter)1 DummyColumnConverter (org.apache.drill.exec.record.ColumnConverter.DummyColumnConverter)1 MapColumnConverter (org.apache.drill.exec.record.ColumnConverter.MapColumnConverter)1 ScalarColumnConverter (org.apache.drill.exec.record.ColumnConverter.ScalarColumnConverter)1 ObjectWriter (org.apache.drill.exec.vector.accessor.ObjectWriter)1