yyanyy commented on code in PR #57585:
URL: https://github.com/apache/spark/pull/57585#discussion_r3732590089
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/RelationCatalog.java:
##########
@@ -134,6 +135,26 @@ public interface RelationCatalog extends TableCatalog,
ViewCatalog {
*/
Relation loadRelation(Identifier ident) throws NoSuchTableException;
+ /**
+ * Load the relation for an identifier that may resolve to either a table or
a view, forwarding
+ * all user-specified options.
+ * <p>
+ * Behaves like {@link #loadRelation(Identifier)} but also receives the
options passed to the
+ * read. The default implementation ignores {@code options} and delegates to
+ * {@link #loadRelation(Identifier)}; catalogs that want to receive the user
options while
+ * reading a relation must override this method.
+ *
+ * @param ident the identifier
+ * @param options all options passed to the read
+ * @return a {@link Table} for tables, or a {@link View} for views
+ * @throws NoSuchTableException if neither a table nor a view exists at
{@code ident}
+ * @since 4.3.0
+ */
+ default Relation loadRelation(Identifier ident, CaseInsensitiveStringMap
options)
Review Comment:
thanks for the review and the finding! great catch, addressed; was also
thinking if I should create other APIs so that we don't check for time
travel/write privileges in two different classes but eventually felt that it
might be better to not continue adding more loadTable variants.
--
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]