Skip to content

Tags: khwj/spark

Tags

v3.2.0

Toggle v3.2.0's commit message
Automatically build docker images

v3.2.0-rc7

Toggle v3.2.0-rc7's commit message
Preparing Spark release v3.2.0-rc7

v3.2.0-rc6

Toggle v3.2.0-rc6's commit message
Preparing Spark release v3.2.0-rc6

v3.2.0-rc5

Toggle v3.2.0-rc5's commit message
Preparing Spark release v3.2.0-rc5

v3.2.0-rc4

Toggle v3.2.0-rc4's commit message
Preparing Spark release v3.2.0-rc4

v3.2.0-rc3

Toggle v3.2.0-rc3's commit message
Preparing Spark release v3.2.0-rc3

v3.2.0-rc2

Toggle v3.2.0-rc2's commit message
Preparing Spark release v3.2.0-rc2

v3.2.0-rc1

Toggle v3.2.0-rc1's commit message
Preparing Spark release v3.2.0-rc1

v3.1.2-ci

Toggle v3.1.2-ci's commit message
Add GitHub workflow for building runnable distributions

v3.1.2-glue-1.10.0-SNAPSHOT

Toggle v3.1.2-glue-1.10.0-SNAPSHOT's commit message
[SPARK-36089][SQL][DOCS] Update the SQL migration guide about encodin…

…g auto-detection of CSV files

### What changes were proposed in this pull request?
In the PR, I propose to update the SQL migration guide, in particular the section about the migration from Spark 2.4 to 3.0. New item informs users about the following issue:

**What**: Spark doesn't detect encoding (charset) in CSV files with BOM correctly. Such files can be read only in the multiLine mode when the CSV option encoding matches to the actual encoding of CSV files. For example, Spark cannot read UTF-16BE CSV files when encoding is set to UTF-8 which is the default mode. This is the case of the current ES ticket.

**Why**: In previous Spark versions, encoding wasn't propagated to the underlying library that means the lib tried to detect file encoding automatically. It could success for some encodings that require BOM presents at the beginning of files. Starting from the versions 3.0, users can specify file encoding via the CSV option encoding which has UTF-8 as the default value. Spark propagates such default to the underlying library (uniVocity), and as a consequence this turned off encoding auto-detection.

**When**: Since Spark 3.0. In particular, the commit apache@2df34db causes the issue.

**Workaround**: Enabling the encoding auto-detection mechanism in uniVocity by passing null as the value of CSV option encoding. A more recommended approach is to set the encoding option explicitly.

### Why are the changes needed?
To improve user experience with Spark SQL. This should help to users in their migration from Spark 2.4.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Should be checked by building docs in GA/jenkins.

Closes apache#33300 from MaxGekk/csv-encoding-migration-guide.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>