rdblue commented on a change in pull request #3745:
URL: https://github.com/apache/iceberg/pull/3745#discussion_r780824225



##########
File path: 
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java
##########
@@ -768,9 +775,22 @@ public static TableIdentifier 
identifierToTableIdentifier(Identifier identifier)
 
     org.apache.spark.sql.execution.datasources.PartitionSpec spec = 
fileIndex.partitionSpec();
     StructType schema = spec.partitionColumns();
+    if (schema.isEmpty()) {
+      return Lists.newArrayList();
+    }
+
+    List<org.apache.spark.sql.catalyst.expressions.Expression> 
filterExpressions =
+        getPartitionFilterExpressions(spark, tableName, partitionFilter);
+
+    List<org.apache.spark.sql.catalyst.expressions.Expression> dataFilters = 
Lists.newArrayList();
+    Seq<org.apache.spark.sql.catalyst.expressions.Expression> 
scalaPartitionFilters =
+        
JavaConverters.asScalaBufferConverter(filterExpressions).asScala().toSeq();
+    Seq<org.apache.spark.sql.catalyst.expressions.Expression> scalaDataFilters 
=
+        JavaConverters.asScalaBufferConverter(dataFilters).asScala().toSeq();

Review comment:
       Is there an easier way to construct an empty sequence? Also, since this 
is always empty, can you put the `dataFilters` definition and this line next to 
one another? The line to create `scalaPartitionFilters` can be next to the line 
above that creates `filterExpressions`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to