aokolnychyi commented on code in PR #57799:
URL: https://github.com/apache/spark/pull/57799#discussion_r3770843493


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableCatalog.java:
##########
@@ -196,12 +196,35 @@ default Table loadTable(Identifier ident, long timestamp) 
throws NoSuchTableExce
   }
 
   /**
-   * Load table metadata by {@link Identifier identifier} from the catalog, 
forwarding all
-   * user-specified options.
+   * Returns the raw option keys that may affect the table state selected by
+   * {@link #loadTable(Identifier, TableContext, CaseInsensitiveStringMap)}, 
such as a branch, tag,
+   * snapshot, or version.
    * <p>
-   * The default implementation ignores {@code options} and delegates to the 
existing
+   * Spark may need to resolve the same table more than once while analyzing 
or refreshing a query.
+   * Spark reuses one table instance only for references whose table-state 
options match and passes
+   * only the declared options to {@code loadTable}. The complete user option 
map remains on each
+   * resolved relation for subsequent scan and write planning.
+   * <p>
+   * The default implementation returns an empty set, treating all options as 
unable to select a
+   * different table state. Option key matching is case-insensitive, while 
option values remain
+   * case-sensitive. State that Spark parses and handles independently, such 
as time travel, must
+   * not be included in the returned set.
+   *
+   * @return a non-null set of case-insensitive option keys
+   *
+   * @since 4.3.0
+   */
+  default Set<String> tableStateOptionKeys() { return Set.of(); }

Review Comment:
   Shall we define this above after capabilities()?



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