@Test public void testUnIndexedWithOutArray() { SchemaPath oneElementSchema = SchemaPath.parseFromString("`a`"); assertEquals("Schema path should match", oneElementSchema, oneElementSchema.getUnIndexed()); SchemaPath severalElementsSchema = SchemaPath.parseFromString("`a`.`b`.`c`"); assertEquals("Schema path should match", severalElementsSchema, severalElementsSchema.getUnIndexed()); }
@Test public void testUnIndexedArrayInTheMiddle() { SchemaPath schemaPath = SchemaPath.parseFromString("`a`.`b`[0].`c`.`d`"); assertEquals("Schema path should match", SchemaPath.parseFromString("`a`.`b`.`c`.`d`"), schemaPath.getUnIndexed()); }
@Test public void testUnIndexedMultipleArrays() { SchemaPath schemaPath = SchemaPath.parseFromString("`a`.`b`[0][1].`c`.`d`[2][0]"); assertEquals("Schema path should match", SchemaPath.parseFromString("`a`.`b`.`c`.`d`"), schemaPath.getUnIndexed()); }
@Test public void testUnIndexedEndingWithArray() { SchemaPath schemaPath = SchemaPath.parseFromString("`a`.`b`[0]"); assertEquals("Schema path should match", SchemaPath.parseFromString("`a`.`b`"), schemaPath.getUnIndexed()); }
/** * Check if one of the fields involved in the filter is an array (used in DRILL_6259_test_data). * * @return true if one at least is an array, false otherwise. */ private static boolean isRepeated(Set<SchemaPath> fields, ParquetTableMetadataBase parquetTableMetadata, List<? extends ColumnMetadata> columnMetadataList) { final Map<SchemaPath, ColumnMetadata> columnMetadataMap = new HashMap<>(); for (final ColumnMetadata columnMetadata : columnMetadataList) { SchemaPath schemaPath = SchemaPath.getCompoundPath(columnMetadata.getName()); columnMetadataMap.put(schemaPath, columnMetadata); } for (final SchemaPath field : fields) { ColumnMetadata columnMetadata = columnMetadataMap.get(field.getUnIndexed()); if (columnMetadata != null && parquetTableMetadata.getRepetitionLevel(columnMetadata.getName()) >= 1) { return true; } } return false; }
/** * Determine if a Parquet column is selected for the query. It is selected * either if this is a star query (we want all columns), or the column * appears in the select list. * * @param column the Parquet column expressed as column descriptor * @return true if the column is to be included in the scan, false * if not */ private boolean columnSelected(ColumnDescriptor column) { if (isStarQuery()) { return true; } int i = 0; for (SchemaPath expr : selectedCols) { if (ParquetReaderUtility.getFullColumnPath(column).equalsIgnoreCase(expr.getUnIndexed().toString())) { columnsFound[i] = true; return true; } i++; } return false; }
logger.trace("rowGroupScan contains complex column: {}", schemaPath.getUnIndexed().toString()); return true; ColumnDescriptor column = colDescMap.get(schemaPath.getUnIndexed().toString().toLowerCase()); SchemaElement schemaElement = schemaElements.get(schemaPath.getUnIndexed().toString().toLowerCase()); if (schemaElement != null) { return true; logger.trace("rowGroupScan contains repetitive column: {}", schemaPath.getUnIndexed().toString()); return true;
|| getFullColumnPath(column).equalsIgnoreCase(schemaPath.getUnIndexed().toString())) { int colIndex = -1; ConvertedType convertedType = schemaElements.get(getFullColumnPath(column)).getConverted_type();
ColumnMetadata columnMetadata = columnMetadataMap.get(field.getUnIndexed()); if (columnMetadata != null) { ColumnStatisticsBuilder statisticsBuilder = ColumnStatisticsBuilder.builder()