You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/04 07:59:19 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #27302:
[SPARK-30506][SQL][DOC] Document for generic file source options/configs
cloud-fan commented on a change in pull request #27302: [SPARK-30506][SQL][DOC] Document for generic file source options/configs
URL: https://github.com/apache/spark/pull/27302#discussion_r374519656
##########
File path: examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java
##########
@@ -106,6 +107,48 @@ public static void main(String[] args) {
spark.stop();
}
+ private static void runGenericFileSourceOptionsExample(SparkSession spark) {
+ // $example on:ignore_corrupt_files$
+ // enable ignore corrupt files
+ spark.sql("set spark.sql.files.ignoreCorruptFiles=true");
+ // dir1/file3.json is corrupt from parquet's view
+ Dataset<Row> testCorruptDF = spark.read().parquet(
+ "examples/src/main/resources/dir1/",
+ "examples/src/main/resources/dir1/dir2/");
+ testCorruptDF.show();
+ // +-------------+
+ // | file|
+ // +-------------+
+ // |file1.parquet|
+ // |file2.parquet|
+ // +-------------+
+ // $example off:ignore_corrupt_files$
+ // $example on:load_with_path_glob_filter$
+ Dataset<Row> partitionedUsersDF = spark.read().format("parquet")
Review comment:
nit: partitionedUsersDF -> testGlobFilter
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org