viirya commented on a change in pull request #31989:
URL: https://github.com/apache/spark/pull/31989#discussion_r668488747



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StreamingSessionWindowStateManager.scala
##########
@@ -0,0 +1,370 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.streaming.state
+
+import scala.collection.mutable.ArrayBuffer
+
+import org.apache.spark.internal.Logging
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.catalyst.expressions.{Attribute, Literal, 
UnsafeProjection, UnsafeRow}
+import 
org.apache.spark.sql.catalyst.expressions.codegen.GenerateUnsafeProjection
+import org.apache.spark.sql.types.{StructType, TimestampType}
+import org.apache.spark.util.NextIterator
+
+sealed trait StreamingSessionWindowStateManager extends Serializable {
+  /**
+   * Returns the schema for key of the state.
+   */
+  def getStateKeySchema: StructType
+
+  /**
+   * Returns the schema for value of the state.
+   */
+  def getStateValueSchema: StructType
+
+  /**
+   * Returns the number of columns for `prefix key` in key schema.
+   */
+  def getNumColsForPrefixKey: Int
+
+  /**
+   * Extracts the key without session window from the row.
+   * This can be used to group session windows by key.
+   */
+  def extractKeyWithoutSession(value: UnsafeRow): UnsafeRow
+
+  /**
+   * Check whether the given value is a new session, or the session has been
+   * updated.
+   * This can be used to control the output in UPDATE mode.
+   */

Review comment:
       This looks confusing. Maybe "Returns true if the session of the given 
value doesn't exist in the store, or the value in the session is different to 
the stored value of the session in the store."




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