cloud-fan commented on code in PR #56606:
URL: https://github.com/apache/spark/pull/56606#discussion_r3456180350
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/DelegatingTable.java:
##########
@@ -27,40 +27,35 @@
import org.apache.spark.sql.connector.expressions.Transform;
/**
- * A concrete {@code Table} implementation that contains only table metadata,
deferring
- * read/write to Spark. It represents a general Spark data source table or a
Spark view;
- * Spark resolves the table provider into a data source (for tables) or
expands the view text
- * (for views) at read time.
+ * A concrete {@link Table} that adapts a {@link TableInfo} -- it contains
only table metadata and
+ * defers read/write to Spark, which resolves the table provider into a data
source at read time.
* <p>
- * Catalogs build the metadata via {@link TableInfo.Builder} (for data-source
tables) or
- * {@link ViewInfo.Builder} (for views). A {@code MetadataTable} wrapping a
- * {@link TableInfo} can be returned from {@link
TableCatalog#loadTable(Identifier)} for a
- * data-source table; a {@code MetadataTable} wrapping a {@link ViewInfo} can
be returned
- * from {@link TableViewCatalog#loadTableOrView(Identifier)} as the single-RPC
perf opt-in
- * for a view.
- * Downstream consumers distinguish the two by checking
- * {@code getTableInfo() instanceof ViewInfo}.
+ * Catalogs build the metadata via {@link TableInfo.Builder} and return a
{@code DelegatingTable}
+ * from {@link TableCatalog#loadTable(Identifier)} (or {@link
RelationCatalog#loadRelation} for a
+ * data-source table) when they want Spark to handle the underlying source. A
catalog that has its
+ * own {@link Table} object returns that instead. Views are never represented
as a
+ * {@code DelegatingTable}: a view is a {@link View}, which is itself a {@link
Relation}.
*
* @since 4.2.0
*/
@Evolving
-public class MetadataTable implements Table {
+public class DelegatingTable implements Table {
Review Comment:
I think non-catalog v2 data source can also use it. The key is delegating
the data source resolution to the spark catalog.
--
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]