Java Code Examples for org.apache.parquet.io.api.Converter#asPrimitiveConverter()
The following examples show how to use
org.apache.parquet.io.api.Converter#asPrimitiveConverter() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilteringGroupConverter.java From parquet-mr with Apache License 2.0 | 6 votes |
@Override public Converter getConverter(int fieldIndex) { // get the real converter from the delegate Converter delegateConverter = Objects.requireNonNull(delegate.getConverter(fieldIndex), "delegate converter cannot be null"); // determine the indexFieldPath for the converter proxy we're about to make, which is // this converter's path + the requested fieldIndex List<Integer> newIndexFieldPath = new ArrayList<>(indexFieldPath.size() + 1); newIndexFieldPath.addAll(indexFieldPath); newIndexFieldPath.add(fieldIndex); if (delegateConverter.isPrimitive()) { PrimitiveColumnIO columnIO = getColumnIO(newIndexFieldPath); ColumnPath columnPath = ColumnPath.get(columnIO.getColumnDescriptor().getPath()); ValueInspector[] valueInspectors = getValueInspectors(columnPath); return new FilteringPrimitiveConverter(delegateConverter.asPrimitiveConverter(), valueInspectors); } else { return new FilteringGroupConverter(delegateConverter.asGroupConverter(), newIndexFieldPath, valueInspectorsByColumn, columnIOsByIndexFieldPath); } }
Example 2
Source File: ColumnReadStoreImpl.java From parquet-mr with Apache License 2.0 | 5 votes |
private PrimitiveConverter getPrimitiveConverter(ColumnDescriptor path) { Type currentType = schema; Converter currentConverter = recordConverter; for (String fieldName : path.getPath()) { final GroupType groupType = currentType.asGroupType(); int fieldIndex = groupType.getFieldIndex(fieldName); currentType = groupType.getType(fieldName); currentConverter = currentConverter.asGroupConverter().getConverter(fieldIndex); } PrimitiveConverter converter = currentConverter.asPrimitiveConverter(); return converter; }