Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19429#discussion_r143288202
--- Diff:
examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java
---
@@ -115,7 +115,20 @@ private static void
runBasicDataSourceExample(SparkSession spark) {
Dataset<Row> peopleDF =
spark.read().format("json").load("examples/src/main/resources/people.json");
peopleDF.select("name",
"age").write().format("parquet").save("namesAndAges.parquet");
- // $example off:manual_load_options$
+ // $example on:manual_load_options_csv$
+ Dataset<Row> peopleDFCsv = spark.read().format("csv")
+ .option("sep", ";")
+ .option("inferSchema", "true")
+ .option("header", "true")
+ .load("examples/src/main/resources/people.csv");
+ // $example off:manual_load_options_csv$
+ // $example on:manual_load_options_csv$
+ Dataset<Row> peopleDFCsv = spark.read().format("csv")
+ .option("sep", ";")
+ .option("inferSchema", "true")
+ .option("header", "true")
+ .load("examples/src/main/resources/people.csv");
+ // $example off:manual_load_options_csv$
--- End diff --
Line 125-131 is a duplicate.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]