huaxingao commented on a change in pull request #3745:
URL: https://github.com/apache/iceberg/pull/3745#discussion_r769182194
##########
File path:
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java
##########
@@ -779,10 +800,54 @@ public static TableIdentifier
identifierToTableIdentifier(Identifier identifier)
Object value =
CatalystTypeConverters.convertToScala(catalystValue, field.dataType());
values.put(field.name(), value.toString());
});
- return new SparkPartition(values, partition.path().toString(),
format);
+ FileStatus fileStatus =
+
scala.collection.JavaConverters.seqAsJavaListConverter(partition.files()).asJava().get(0);
+
+ return new SparkPartition(values,
fileStatus.getPath().getParent().toString(), format);
}).collect(Collectors.toList());
}
+ private static List getPartitionFilterExpressions(StructType schema,
+ Map<String, String>
partitionFilter) {
+ List<org.apache.spark.sql.catalyst.expressions.Expression>
filterExpressions = new java.util.ArrayList<>();
+ for (Map.Entry<String, String> entry : partitionFilter.entrySet()) {
+ try {
+ // IllegalArgumentException is thrown if schema doesn't contain this
entry,
Review comment:
I tried `spark.parser.parseExpression("dept = hr")`, we will get a
`EqualTo` filter with left side `UnresolvedAttribute` dept and right side
`UnresolvedAttribute` hr. I think in `RewriteDataFilesProcedure` we will
execute and the `UnresolvedAttribute` will get resolved. But in the case of
`listFiles`, it doesn't go through the name resolution code and
`UnresolvedAttribute` remains to be unresolved and cause problem.
I think I will have to manually construct this `EqualTo` filter. I will
check more to see if I can find a better solution.
--
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]