amaliujia commented on code in PR #38395:
URL: https://github.com/apache/spark/pull/38395#discussion_r1010010032


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:
##########
@@ -2101,3 +2101,53 @@ object AsOfJoin {
     }
   }
 }
+
+
+/**
+ * A logical plan for summary.
+ */
+case class UnresolvedSummary(
+    child: LogicalPlan,
+    statistics: Seq[String]) extends UnaryNode {
+
+  private lazy val supported =
+    Set("count", "count_distinct", "approx_count_distinct", "mean", "stddev", 
"min", "max")
+
+  {
+    // TODO: throw AnalysisException instead
+    require(statistics.nonEmpty)

Review Comment:
   I am thinking this is easy to handle in this PR:
   
   either we return the original plan in `ResolveStatsFunctions` when we find 
`UnresolvedSummary` has empty `statistics` thus the plan will remain 
`unresolved` and will fail at last, or we through the compilation exception in 
`ResolveStatsFunctions` when seeing empty `statistics`.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:
##########
@@ -2101,3 +2101,53 @@ object AsOfJoin {
     }
   }
 }
+
+
+/**
+ * A logical plan for summary.
+ */
+case class UnresolvedSummary(
+    child: LogicalPlan,
+    statistics: Seq[String]) extends UnaryNode {
+
+  private lazy val supported =
+    Set("count", "count_distinct", "approx_count_distinct", "mean", "stddev", 
"min", "max")
+
+  {
+    // TODO: throw AnalysisException instead
+    require(statistics.nonEmpty)

Review Comment:
   I am thinking this is easy to handle in this PR:
   
   either we return the original plan in `ResolveStatsFunctions` when we find 
`UnresolvedSummary` has empty `statistics` thus the plan will remain 
`unresolved` and will fail at last, or we throw the compilation exception in 
`ResolveStatsFunctions` when seeing empty `statistics`.



-- 
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