-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-35395][DOCS] Move ORC data source options from Python and Scala into a single page #32546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e9d4605
0ce01d0
4b3aa58
f29ae05
7bba907
005d87d
aa54b45
3740c52
2e0787c
eca1295
0b0e183
6358d59
69b6d84
0df8b04
3971dd8
043d308
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,3 +172,29 @@ When reading from Hive metastore ORC tables and inserting to Hive metastore ORC | |
| <td>2.0.0</td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| ## Data Source Option | ||
|
|
||
| Data source options of ORC can be set via: | ||
| * the `.option`/`.options` methods of | ||
| * `DataFrameReader` | ||
| * `DataFrameWriter` | ||
| * `DataStreamReader` | ||
| * `DataStreamWriter` | ||
|
|
||
| <table class="table"> | ||
| <tr><th><b>Property Name</b></th><th><b>Default</b></th><th><b>Meaning</b></th><th><b>Scope</b></th></tr> | ||
| <tr> | ||
| <td><code>mergeSchema</code></td> | ||
| <td>None</td> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @itholic it has the same issue. The default value isn't |
||
| <td>sets whether we should merge schemas collected from all ORC part-files. This will override <code>spark.sql.orc.mergeSchema</code>. The default value is specified in <code>spark.sql.orc.mergeSchema</code>.</td> | ||
| <td>read</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>compression</code></td> | ||
| <td>None</td> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case when the default value doesn't exist, you can follow https://spark.apache.org/docs/latest/configuration.html#runtime-sql-configuration |
||
| <td>compression codec to use when saving to file. This can be one of the known case-insensitive shorten names (none, snappy, zlib, lzo, and zstd). This will override <code>orc.compress</code> and <code>spark.sql.orc.compression.codec</code>. If None is set, it uses the value specified in <code>spark.sql.orc.compression.codec</code>.</td> | ||
| <td>write</td> | ||
| </tr> | ||
| </table> | ||
| Other generic options can be found in <a href="https://spark.apache.org/docs/latest/sql-data-sources-generic-options.html"> Generic File Source Options</a>. | ||
itholic marked this conversation as resolved.
Show resolved
Hide resolved
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although I know that this is inherited, Like this PR, we don't know what refactoring happens in the future.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, @dongjoon-hyun . |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -793,28 +793,13 @@ def orc(self, path, mergeSchema=None, pathGlobFilter=None, recursiveFileLookup=N | |
| Parameters | ||
| ---------- | ||
| path : str or list | ||
| mergeSchema : str or bool, optional | ||
| sets whether we should merge schemas collected from all | ||
| ORC part-files. This will override ``spark.sql.orc.mergeSchema``. | ||
| The default value is specified in ``spark.sql.orc.mergeSchema``. | ||
| pathGlobFilter : str or bool | ||
| an optional glob pattern to only include files with paths matching | ||
| the pattern. The syntax follows `org.apache.hadoop.fs.GlobFilter`. | ||
| It does not change the behavior of | ||
| `partition discovery <https://spark.apache.org/docs/latest/sql-data-sources-parquet.html#partition-discovery>`_. # noqa | ||
| recursiveFileLookup : str or bool | ||
| recursively scan a directory for files. Using this option | ||
| disables | ||
| `partition discovery <https://spark.apache.org/docs/latest/sql-data-sources-parquet.html#partition-discovery>`_. # noqa | ||
|
|
||
| modification times occurring before the specified time. The provided timestamp | ||
| must be in the following format: YYYY-MM-DDTHH:mm:ss (e.g. 2020-06-01T13:00:00) | ||
| modifiedBefore : an optional timestamp to only include files with | ||
| modification times occurring before the specified time. The provided timestamp | ||
| must be in the following format: YYYY-MM-DDTHH:mm:ss (e.g. 2020-06-01T13:00:00) | ||
| modifiedAfter : an optional timestamp to only include files with | ||
| modification times occurring after the specified time. The provided timestamp | ||
| must be in the following format: YYYY-MM-DDTHH:mm:ss (e.g. 2020-06-01T13:00:00) | ||
| Other Parameters | ||
| ---------------- | ||
| Extra options | ||
| For the extra options, refer to | ||
| `Data Source Option <https://spark.apache.org/docs/latest/sql-data-sources-orc.html#data-source-option>`_ # noqa | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. Can we have a more robust link here? |
||
| in the version you use. | ||
|
|
||
| Examples | ||
| -------- | ||
|
|
@@ -1417,12 +1402,13 @@ def orc(self, path, mode=None, partitionBy=None, compression=None): | |
| exists. | ||
| partitionBy : str or list, optional | ||
| names of partitioning columns | ||
| compression : str, optional | ||
| compression codec to use when saving to file. This can be one of the | ||
| known case-insensitive shorten names (none, snappy, zlib, lzo, and zstd). | ||
| This will override ``orc.compress`` and | ||
| ``spark.sql.orc.compression.codec``. If None is set, it uses the value | ||
| specified in ``spark.sql.orc.compression.codec``. | ||
|
|
||
| Other Parameters | ||
| ---------------- | ||
| Extra options | ||
| For the extra options, refer to | ||
| `Data Source Option <https://spark.apache.org/docs/latest/sql-data-sources-orc.html#data-source-option>`_ # noqa | ||
| in the version you use. | ||
|
|
||
| Examples | ||
| -------- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -874,23 +874,10 @@ class DataFrameReader private[sql](sparkSession: SparkSession) extends Logging { | |
| /** | ||
| * Loads ORC files and returns the result as a `DataFrame`. | ||
| * | ||
| * You can set the following ORC-specific option(s) for reading ORC files: | ||
| * <ul> | ||
| * <li>`mergeSchema` (default is the value specified in `spark.sql.orc.mergeSchema`): sets whether | ||
| * we should merge schemas collected from all ORC part-files. This will override | ||
| * `spark.sql.orc.mergeSchema`.</li> | ||
| * <li>`pathGlobFilter`: an optional glob pattern to only include files with paths matching | ||
| * the pattern. The syntax follows <code>org.apache.hadoop.fs.GlobFilter</code>. | ||
| * It does not change the behavior of partition discovery.</li> | ||
| * <li>`modifiedBefore` (batch only): an optional timestamp to only include files with | ||
| * modification times occurring before the specified Time. The provided timestamp | ||
| * must be in the following form: YYYY-MM-DDTHH:mm:ss (e.g. 2020-06-01T13:00:00)</li> | ||
| * <li>`modifiedAfter` (batch only): an optional timestamp to only include files with | ||
| * modification times occurring after the specified Time. The provided timestamp | ||
| * must be in the following form: YYYY-MM-DDTHH:mm:ss (e.g. 2020-06-01T13:00:00)</li> | ||
| * <li>`recursiveFileLookup`: recursively scan a directory for files. Using this option | ||
| * disables partition discovery</li> | ||
| * </ul> | ||
| * ORC-specific option(s) for reading ORC files can be found in | ||
itholic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * <a href= | ||
| * "https://spark.apache.org/docs/latest/sql-data-sources-orc.html#data-source-option"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
| * Data Source Option</a> in the version you use. | ||
| * | ||
| * @param paths input paths | ||
| * @since 2.0.0 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also mention: