arina-ielchiieva commented on a change in pull request #1370: DRILL-5797: Use
Parquet new reader more often
URL: https://github.com/apache/drill/pull/1370#discussion_r201324236
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetScanBatchCreator.java
##########
@@ -191,4 +201,42 @@ protected AbstractDrillFileSystemManager(OperatorContext
operatorContext) {
protected abstract DrillFileSystem get(Configuration config, String path)
throws ExecutionSetupException;
}
+ /**
+ * Check whether any of queried columns is nested or repetitive.
+ *
+ * @param footer Parquet file schema
+ * @param columns list of query SchemaPath objects
+ */
+ public static boolean containsComplexColumn(ParquetMetadata footer,
List<SchemaPath> columns) {
+
+ Map<String, ColumnDescriptor> colDescMap =
ParquetReaderUtility.getColNameToColumnDescriptorMapping(footer);
+ Map<String, SchemaElement> schemaElements =
ParquetReaderUtility.getColNameToSchemaElementMapping(footer);
+
+ for (SchemaPath schemaPath : columns) {
+ // non-nested column check: full path must be equal to root segment path
+ if (!schemaPath.getUnIndexed().toString().replaceAll("`", "")
Review comment:
That's definitely not a good choice of comparing by replacing "`". Please
find a different way to compare or write helper method that would compare
without replacing, maybe traversing schema path. Schema path has plenty of
handy methods, if needed is missing implement one. Basically you cannot rely on
to string representation it can change, you should rely on object info instead.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services