@Override public Converter getConverter(int fieldIndex) { // get the real converter from the delegate Converter delegateConverter = checkNotNull(delegate.getConverter(fieldIndex), "delegate converter"); // 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<Integer>(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); } }
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; }
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; }
@Override public Converter getConverter(int fieldIndex) { // get the real converter from the delegate Converter delegateConverter = checkNotNull(delegate.getConverter(fieldIndex), "delegate converter"); // 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<Integer>(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); } }
GroupConverter current = this.recordRootConverter; for (int j = 0; j < indexFieldPath.length - 1; j++) { current = current.getConverter(indexFieldPath[j]).asGroupConverter(); groupConverterPaths[i][j] = current; leafConverters[i] = current.getConverter(indexFieldPath[indexFieldPath.length - 1]).asPrimitiveConverter(); columnReaders[i] = columnStore.getColumnReader(leafColumnIO.getColumnDescriptor()); int maxRepetitionLevel = leafColumnIO.getRepetitionLevel();
GroupConverter current = this.recordRootConverter; for (int j = 0; j < indexFieldPath.length - 1; j++) { current = current.getConverter(indexFieldPath[j]).asGroupConverter(); groupConverterPaths[i][j] = current; leafConverters[i] = current.getConverter(indexFieldPath[indexFieldPath.length - 1]).asPrimitiveConverter(); columnReaders[i] = columnStore.getColumnReader(leafColumnIO.getColumnDescriptor()); int maxRepetitionLevel = leafColumnIO.getRepetitionLevel();