Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23266#discussion_r240073831
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/sources/v2/SupportsBatchRead.java 
---
    @@ -20,14 +20,27 @@
     import org.apache.spark.annotation.Evolving;
     import org.apache.spark.sql.sources.v2.reader.Scan;
     import org.apache.spark.sql.sources.v2.reader.ScanBuilder;
    +import org.apache.spark.sql.types.StructType;
     
     /**
    - * An empty mix-in interface for {@link Table}, to indicate this table 
supports batch scan.
    - * <p>
    - * If a {@link Table} implements this interface, its {@link 
Table#newScanBuilder(DataSourceOptions)}
    - * must return a {@link ScanBuilder} that builds {@link Scan} with {@link 
Scan#toBatch()}
    - * implemented.
    - * </p>
    + * A mix-in interface for {@link Table} to provide data reading ability of 
batch processing.
      */
     @Evolving
    -public interface SupportsBatchRead extends Table { }
    +public interface SupportsBatchRead extends Table {
    +
    +  /**
    +   * Returns the schema of this table.
    +   */
    +  StructType schema();
    +
    +  /**
    +   * Returns a {@link ScanBuilder} which can be used to build a {@link 
Scan} later. The built
    +   * {@link Scan} must implement {@link Scan#toBatch()}. Spark will call 
this method for each data
    +   * scanning query.
    +   * <p>
    +   * The builder can take some query specific information to do operators 
pushdown, and keep these
    +   * information in the created {@link Scan}.
    +   * </p>
    +   */
    +  ScanBuilder newScanBuilder(DataSourceOptions options);
    --- End diff --
    
    +1


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to