You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/24 04:12:04 UTC

[GitHub] [spark] nyingping commented on a change in pull request #35680: [SPARK-38349][SS] No need to filter events when sessionwindow gapDuration greater than 0

nyingping commented on a change in pull request #35680:
URL: https://github.com/apache/spark/pull/35680#discussion_r833899929



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -4061,10 +4061,30 @@ object SessionWindowing extends Rule[LogicalPlan] {
           case s: SessionWindow => sessionAttr
         }
 
+        def isGapInvalid(child: Expression): Boolean = {
+          val calendarInterval = IntervalUtils
+            .safeStringToInterval(UTF8String.fromString(child.toString))
+          calendarInterval == null ||
+            calendarInterval.months + calendarInterval.days + calendarInterval.microseconds <= 0
+        }
+
+        val filterTimeSize = gapDuration match {

Review comment:
       @HeartSaVioR
    Thanks for review!
   
   I thought it is that there are three cases, including static gap duration, case when expression and user-defined function. When UDF, it needs to be filtered. Otherwise, there are gap duration and case when. In the case of case when, iterate its child nodes.I'm not quite sure if there are forms other than these three cases.




-- 
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-unsubscribe@spark.apache.org

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



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