You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Milan Stefanovic (Jira)" <ji...@apache.org> on 2024/08/05 13:22:00 UTC
[jira] [Created] (SPARK-49113) Remove assert when translating expressions in DataSourceStrategy when
Milan Stefanovic created SPARK-49113:
----------------------------------------
Summary: Remove assert when translating expressions in DataSourceStrategy when
Key: SPARK-49113
URL: https://issues.apache.org/jira/browse/SPARK-49113
Project: Spark
Issue Type: Improvement
Components: Spark Core
Affects Versions: 4.0.0
Reporter: Milan Stefanovic
In `DataSourceV2Strategy`, when we translate filters, we initialise `V2ExpressionBuilder` and assert that return type of translation is instance of Predicate.
Given that `V2ExpressionBuilder` does not have compiler gurantees of returning Predicates, this makes it very easy to create bugs, and make regressions.
E.g. we add a new translation for expression which returns boolean, but forget to inherit it from predicate. Now suddenly queries that have this expression in their filter will start failing - because we will try to push it down and assert will fail.
Instead of this approach - we should have option to swallow and absorb bugs from V2ExpressionBuilder by returning `None` whenever we encounter expression which is Predicate.
This way, it is as if we are saying:
If translated expression is not of type `Predicate` act as if we didn't know how to translate expression for this particular example.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org