cloud-fan commented on a change in pull request #25204:
[SPARK-28441][SQL][Python] Fix error when PythonUDF is used in correlated
scalar subquery
URL: https://github.com/apache/spark/pull/25204#discussion_r305756639
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala
##########
@@ -354,27 +368,21 @@ object RewriteCorrelatedScalarSubquery extends
Rule[LogicalPlan] {
* [[org.apache.spark.sql.catalyst.analysis.CheckAnalysis]]. If the checks in
* CheckAnalysis become less restrictive, this method will need to change.
*/
- private def evalSubqueryOnZeroTups(plan: LogicalPlan) : Option[Any] = {
+ private def evalSubqueryOnZeroTups(plan: LogicalPlan) : Option[Expression] =
{
// Inputs to this method will start with a chain of zero or more
SubqueryAlias
// and Project operators, followed by an optional Filter, followed by an
// Aggregate. Traverse the operators recursively.
- def evalPlan(lp : LogicalPlan) : Map[ExprId, Option[Any]] = lp match {
+ def evalPlan(lp : LogicalPlan) : Map[ExprId, Option[Expression]] = lp
match {
case SubqueryAlias(_, child) => evalPlan(child)
case Filter(condition, child) =>
- val bindings = evalPlan(child)
- if (bindings.isEmpty) bindings
- else {
- val exprResult = evalExpr(condition, bindings).getOrElse(false)
- .asInstanceOf[Boolean]
- if (exprResult) bindings else Map.empty
- }
+ evalPlan(child)
Review comment:
shouldn't we evaluate the filter condition?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]