GitHub user liancheng opened a pull request:
https://github.com/apache/spark/pull/7455
[SPARK-4176] [SQL] Supports decimal types with precision > 18 in Parquet
This PR is based on #6796 authored by @rtreffer.
To support large decimal precision (> 18), we do the following things in
this PR:
1. Making `CatalystSchemaConverter` support large decimal precision
Decimal types with large precision are always converted to fixed-length
byte array.
2. Making `CatalystRowConverter` support reading decimal values with large
precision
When the precision is > 18, constructs `Decimal` values with an unscaled
`BigInteger` rather than an unscaled `Long`.
3. Making `RowWriteSupport` support writing decimal values with large
precision
In this PR we always write decimals as fixed-length byte array, because
Parquet write path hasn't been refactored to conform Parquet format spec (see
SPARK-6774 & SPARK-8848).
Two follow-up tasks should be done in future PRs:
- [ ] Writing decimals as `INT32`, `INT64` when possible while fixing
SPARK-8848
- [ ] Adding compatibility tests as part of SPARK-5463
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/liancheng/spark spark-4176
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/7455.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #7455
----
commit 7dd88ce367b8b64485294f6689f4ad734d562530
Author: Cheng Lian <[email protected]>
Date: 2015-07-16T23:33:47Z
Supports decimals with precision > 18 for Parquet
----
---
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]