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

    https://github.com/apache/spark/pull/14119#discussion_r70263657
  
    --- Diff: 
examples/src/main/java/org/apache/spark/examples/sql/JavaSqlDataSourceExample.java
 ---
    @@ -0,0 +1,192 @@
    +package org.apache.spark.examples.sql;
    +
    +// $example on:schema_merging$
    +import java.io.Serializable;
    +import java.util.ArrayList;
    +import java.util.List;
    +// $example off:schema_merging$
    +
    +// $example on:basic_parquet_example$
    +import org.apache.spark.api.java.function.MapFunction;
    +import org.apache.spark.sql.Encoders;
    +// import org.apache.spark.sql.Encoders;
    +// $example on:schema_merging$
    +// $example on:json_dataset$
    +import org.apache.spark.sql.Dataset;
    +import org.apache.spark.sql.Row;
    +// $example off:json_dataset$
    +// $example off:schema_merging$
    +// $example off:basic_parquet_example$
    +import org.apache.spark.sql.SparkSession;
    +
    +public class JavaSqlDataSourceExample {
    +
    +  // $example on:schema_merging$
    +  public static class Square implements Serializable {
    +    private int value;
    +    private int square;
    +
    +    // Getters and setters...
    +    // $example off:schema_merging$
    +    public int getValue() {
    +      return value;
    +    }
    +
    +    public void setValue(int value) {
    +      this.value = value;
    +    }
    +
    +    public int getSquare() {
    +      return square;
    +    }
    +
    +    public void setSquare(int square) {
    +      this.square = square;
    +    }
    +    // $example on:schema_merging$
    +  }
    +  // $example off:schema_merging$
    +
    +  // $example on:schema_merging$
    +  public static class Cube implements Serializable {
    +    private int value;
    +    private int cube;
    +
    +    // Getters and setters...
    +    // $example off:schema_merging$
    +    public int getValue() {
    +      return value;
    +    }
    +
    +    public void setValue(int value) {
    +      this.value = value;
    +    }
    +
    +    public int getCube() {
    +      return cube;
    +    }
    +
    +    public void setCube(int cube) {
    +      this.cube = cube;
    +    }
    +    // $example on:schema_merging$
    +  }
    +  // $example off:schema_merging$
    +
    +  public static void main(String[] args) {
    +    SparkSession spark = SparkSession
    +        .builder()
    +        .appName("Java Spark SQL Data Sources Example")
    +        .config("spark.some.config.option", "some-value")
    +        .getOrCreate();
    --- End diff --
    
    Nit: Use 2-space indentation here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to