HyukjinKwon commented on a change in pull request #23266: [SPARK-26313][SQL] 
move `newScanBuilder` from Table to read related mix-in traits
URL: https://github.com/apache/spark/pull/23266#discussion_r241289160
 
 

 ##########
 File path: sql/core/src/main/java/org/apache/spark/sql/sources/v2/Table.java
 ##########
 @@ -43,17 +41,8 @@
   String name();
 
   /**
-   * Returns the schema of this table.
+   * Returns the schema of this table. If the table is not readable and 
doesn't have a schema, an
+   * empty schema can be returned here.
    */
   StructType schema();
 
 Review comment:
   Eh, sorry if I missed something. I guess `SupportsBatchWrite` is also going 
to extend `Table` .. Am I correct?
   
   Let's suppose one datasource implements both read support and write support. 
How the implemented datasource knows we're in read side or write side when 
`schema` is called?
   
   The source might not be able to know the schema, or fetching schema can be 
potentially expensive. We need a way to distinguish. Otherwise, the interface 
will force to read the schema everytime, which might not be able every time, or 
potentially expensive.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to