Search in sources :

Example 1 with ParquetColumnMetadata

use of org.apache.drill.exec.store.parquet.columnreaders.ParquetColumnMetadata in project drill by apache.

the class RecordBatchSizerManager method loadColumnsPrecisionInfo.

private void loadColumnsPrecisionInfo() {
    assert fixedLengthColumns.size() == 0;
    assert variableLengthColumns.size() == 0;
    for (ParquetColumnMetadata columnMetadata : schema.getColumnMetadata()) {
        assert !columnMetadata.isRepeated() : "This reader doesn't handle repeated columns..";
        ColumnMemoryInfo columnMemoryInfo = new ColumnMemoryInfo();
        columnMemoryInfoMap.put(columnMetadata.getField().getName(), columnMemoryInfo);
        if (columnMetadata.isFixedLength()) {
            columnMemoryInfo.columnMeta = columnMetadata;
            columnMemoryInfo.columnPrecision = BatchSizingMemoryUtil.getFixedColumnTypePrecision(columnMetadata);
            columnMemoryInfo.columnMemoryQuota.reset();
            fixedLengthColumns.add(columnMemoryInfo);
        } else {
            columnMemoryInfo.columnMeta = columnMetadata;
            columnMemoryInfo.columnPrecision = BatchSizingMemoryUtil.getAvgVariableLengthColumnTypePrecision(columnMetadata);
            columnMemoryInfo.columnMemoryQuota.reset();
            variableLengthColumns.add(columnMemoryInfo);
        }
    }
}
Also used : ParquetColumnMetadata(org.apache.drill.exec.store.parquet.columnreaders.ParquetColumnMetadata)

Aggregations

ParquetColumnMetadata (org.apache.drill.exec.store.parquet.columnreaders.ParquetColumnMetadata)1