milastdbx commented on code in PR #47611:
URL: https://github.com/apache/spark/pull/47611#discussion_r1709875387
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala:
##########
@@ -650,10 +651,22 @@ private[sql] object DataSourceV2Strategy extends Logging {
/**
* Get the expression of DS V2 to represent catalyst predicate that can be
pushed down.
*/
-object PushablePredicate {
- def unapply(e: Expression): Option[Predicate] =
- new V2ExpressionBuilder(e, true).build().map { v =>
+object PushablePredicate extends Logging {
+
+ def unapply(e: Expression): Option[Predicate] = {
+ val exprOpt = new V2ExpressionBuilder(e, true).build()
+
+ val modifiedExprOpt =
+ if (SQLConf.get.getConf(SQLConf.DATA_SOURCE_DONT_ASSERT_ON_PREDICATE) &&
+ exprOpt.isDefined &&
+ !exprOpt.get.isInstanceOf[Predicate]) {
+ logWarning(log"Predicate expected but got class: ${MDC(EXPR,
exprOpt.get.describe())}")
+ None
+ } else { exprOpt }
Review Comment:
I fail see whats wrong here ?
Is its two space identation for after codeblock within if - right ?
and 2 spaces for each new line, and 2 spaces for each if condition ?
Are you referring to else branch should be in new line ?
--
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]