cloud-fan commented on code in PR #36150:
URL: https://github.com/apache/spark/pull/36150#discussion_r919715595


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -863,6 +868,36 @@ class Analyzer(override val catalogManager: CatalogManager)
     }
   }
 
+  object ResolveMelt extends Rule[LogicalPlan] {
+    def apply(plan: LogicalPlan): LogicalPlan = 
plan.resolveOperatorsWithPruning(
+      _.containsPattern(MELT), ruleId) {
+
+      // once children and ids are resolved, we can determine values, if non 
were given
+      case m: Melt if m.childrenResolved && m.ids.forall(_.resolved) && 
m.values.isEmpty =>
+        m.copy(values = m.child.output.diff(m.ids))

Review Comment:
   if the id is non-attribute `a + b`, then all attributes are value columns?



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -863,6 +868,36 @@ class Analyzer(override val catalogManager: CatalogManager)
     }
   }
 
+  object ResolveMelt extends Rule[LogicalPlan] {
+    def apply(plan: LogicalPlan): LogicalPlan = 
plan.resolveOperatorsWithPruning(
+      _.containsPattern(MELT), ruleId) {
+
+      // once children and ids are resolved, we can determine values, if non 
were given
+      case m: Melt if m.childrenResolved && m.ids.forall(_.resolved) && 
m.values.isEmpty =>
+        m.copy(values = m.child.output.diff(m.ids))

Review Comment:
   if the id is non-attribute like `a + b`, then all attributes are value 
columns?



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

Reply via email to