You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2023/09/19 14:11:37 UTC
[GitHub] [iceberg] nastra commented on a diff in pull request #8394: Spark 3.4: Rewrite procedure throw better exception when filter expression cannot translate
nastra commented on code in PR #8394:
URL: https://github.com/apache/iceberg/pull/8394#discussion_r1330201036
##########
spark/v3.4/spark/src/main/scala/org/apache/spark/sql/execution/datasources/SparkExpressionConverter.scala:
##########
@@ -36,7 +36,14 @@ object SparkExpressionConverter {
// Currently, it is a double conversion as we are converting Spark expression to Spark predicate
// and then converting Spark predicate to Iceberg expression.
// But these two conversions already exist and well tested. So, we are going with this approach.
- SparkV2Filters.convert(DataSourceV2Strategy.translateFilterV2(sparkExpression).get)
+ DataSourceV2Strategy.translateFilterV2(sparkExpression) match {
+ case Some(filter) =>
+ val converted = SparkV2Filters.convert(filter)
+ assert(converted != null, s"Cannot convert Spark filter: $filter to Iceberg expression")
Review Comment:
Sorry I missed this. Is it normal to use `assert` in Scala? I'd rather prefer throwing IAE here
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org