cloud-fan 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_r241298370
########## 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: I think schema is a property of table, it should be consistent between read and write. But you do have a point that, fetching schema can be potentially expensive, and we shouldn't do it at write side if validation is not needed. We discussed this in the data source v2 community meeting today. We will introduce a capability API, so that data source can tell Spark it doesn't want to do validation, and Spark would not call `schema()`. Does it sound good to you? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org