This is an automated email from the ASF dual-hosted git repository.
gangwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-format.git
The following commit(s) were added to refs/heads/master by this push:
new 60bf83a PARQUET-2264: Allow scale == precision for DecimalType (#198)
60bf83a is described below
commit 60bf83a24c563ab1ae262c399ad8d64cf7ab76ef
Author: Devin Smith <[email protected]>
AuthorDate: Tue Apr 18 18:34:46 2023 -0700
PARQUET-2264: Allow scale == precision for DecimalType (#198)
- The majority of implementations allow for scale == precision.
See https://github.com/apache/arrow-rs/pull/1607 for further motivation.
- Add comments to DecimalType in parquet.thrift
---
LogicalTypes.md | 2 +-
src/main/thrift/parquet.thrift | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/LogicalTypes.md b/LogicalTypes.md
index 8ea3bfe..b387b89 100644
--- a/LogicalTypes.md
+++ b/LogicalTypes.md
@@ -219,7 +219,7 @@ decimal point, and the precision stores the maximum number
of digits supported
in the unscaled value.
If not specified, the scale is 0. Scale must be zero or a positive integer less
-than the precision. Precision is required and must be a non-zero positive
+than or equal to the precision. Precision is required and must be a non-zero
positive
integer. A precision too large for the underlying type (see below) is an error.
`DECIMAL` can be used to annotate the following types:
diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift
index 643309b..aa4375b 100644
--- a/src/main/thrift/parquet.thrift
+++ b/src/main/thrift/parquet.thrift
@@ -245,6 +245,9 @@ struct NullType {} // allowed for any physical type,
only null values stored
/**
* Decimal logical type annotation
*
+ * Scale must be zero or a positive integer less than or equal to the
precision.
+ * Precision must be a non-zero positive integer.
+ *
* To maintain forward-compatibility in v1, implementations using this logical
* type must also set scale and precision on the annotated SchemaElement.
*