Mariamalmesfer commented on code in PR #13050:
URL: https://github.com/apache/gluten/pull/13050#discussion_r4246988787


##########
gluten-substrait/src/main/scala/org/apache/gluten/extension/columnar/validator/Validators.scala:
##########
@@ -299,6 +300,46 @@ object Validators {
                   case _ => false
                 }
             }
+          case w: WindowExec =>
+            w.windowExpression.forall {
+              expr =>
+                expr.collectFirst { case WindowExpression(fn, _) => fn } match 
{
+                  case Some(windowFunction) =>
+                    (!containsNTZ(windowFunction.dataType) &&
+                      !windowFunction.references.exists(a => 
containsNTZ(a.dataType))) ||
+                    windowFunction.exists {
+                      case Lag(input, _, _, _) => containsNTZ(input.dataType)
+                      case Lead(input, _, _, _) => containsNTZ(input.dataType)
+                      case NthValue(input, _, _) => containsNTZ(input.dataType)
+                      case First(child, _) => containsNTZ(child.dataType)
+                      case Last(child, _) => containsNTZ(child.dataType)
+                      case Count(children) => children.exists(c => 
containsNTZ(c.dataType))
+                      case Min(child) => containsNTZ(child.dataType)
+                      case Max(child) => containsNTZ(child.dataType)
+                      // RankLike's children mirror orderSpec; only ever 
compared, not computed.
+                      case _: RankLike => true
+                      case _ => false
+                    }
+                  case None => false
+                }
+            }

Review Comment:
   added checks for partitionSpec and orderSpec in the WindowExec case



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