rdblue commented on a change in pull request #2062: URL: https://github.com/apache/iceberg/pull/2062#discussion_r567178697
########## File path: spark2/src/main/java/org/apache/iceberg/spark/SparkFilters.java ########## @@ -135,6 +136,13 @@ public static Expression convert(Filter filter) { case NOT: Not notFilter = (Not) filter; + Filter sparkChild = notFilter.child(); + // Special case to use the Iceberg NOT_STARTS_WITH operator for + // Not(StringStartsWith) to allow filter push down. + if (sparkChild instanceof StringStartsWith) { + StringStartsWith castedChild = (StringStartsWith) sparkChild; + return notStartsWith(castedChild.attribute(), castedChild.value()); + } Review comment: I don't think this is necessary. It's fine to convert `not(startsWith(...))` to the same structure. The important thing is that when we rewrite to remove `not`, we can produce a `notStartsWith` instead of failing. We probably don't need to touch Spark at all. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org