dbatomic commented on code in PR #44299:
URL: https://github.com/apache/spark/pull/44299#discussion_r1428147244


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -3436,6 +3437,21 @@ class Analyzer(override val catalogManager: 
CatalogManager) extends RuleExecutor
     }
   }
 
+  /**
+   * Transform UnresolvedBetweenExpression into a [BetweenExpr].
+   */
+  object ResolveBetweenExpression extends Rule[LogicalPlan] {

Review Comment:
   This is what I tried initially. I tried to explain the problem in PR 
description, but I guess that I wasn't clear enough. Let me try to do this 
again:
   Initially I tried with `BetweenExpr extends RuntimeReplaceable`. The problem 
that I hit was that `CommonExpressionRef` required dataType of 
`CommonExpressionDef` to be known for it to be created:
   ```scala
     def this(exprDef: CommonExpressionDef) = this(exprDef.id, 
exprDef.dataType, exprDef.nullable)
   ```
   To get around this I would like to create replacement of BetweenExpr after I 
resolve it's Child expressions and hence after I have it's dataType. I hit a 
wall doing this so I did this thing with UnresolvedBetween->BetweenExpr (for 
which I will know the types)->With, which works, but I agree that it would be 
better if we could avoid this + get rid of extra rule.
   
   I will give it another try. If you guys know a way to get around this I 
would appreciate some help :)



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to