HeartSaVioR commented on a change in pull request #33038:
URL: https://github.com/apache/spark/pull/33038#discussion_r667572547



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStore.scala
##########
@@ -60,21 +60,17 @@ trait ReadStateStore {
   def get(key: UnsafeRow): UnsafeRow
 
   /**
-   * Get key value pairs with optional approximate `start` and `end` extents.
-   * If the State Store implementation maintains indices for the data based on 
the optional
-   * `keyIndexOrdinal` over fields `keySchema` (see 
`StateStoreProvider.init()`), then it can use
-   * `start` and `end` to make a best-effort scan over the data. Default 
implementation returns
-   * the full data scan iterator, which is correct but inefficient. Custom 
implementations must
-   * ensure that updates (puts, removes) can be made while iterating over this 
iterator.
+   * Return an iterator containing all the key-value pairs which are matched 
with
+   * the given prefix key.
+   *
+   * Spark will provide numColsPrefixKey greater than 0 in 
StateStoreProvider.init method if
+   * the state store is responsible to handle the request for prefix scan. The 
schema of the
+   * prefix key should be same with the leftmost `numColsPrefixKey` columns of 
the key schema.

Review comment:
       `numColsPrefixKey <= 0` means there's no prefix key. "key with no 
column" doesn't make sense naturally.
   
   What about changing the sentence like below?
   
   ```
   The operator will provide numColsPrefixKey greater than 0 in 
StateStoreProvider.init method if the operator needs to leverage the "prefix 
scan" feature.
   ```
   
   I'll update the doc, and let's see whether it's good for you as well or not.




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