diff --git a/format/parquet.go b/format/parquet.go index 08c1c98..6ecdd3e 100644 --- a/format/parquet.go +++ b/format/parquet.go @@ -134,7 +134,8 @@ type DecimalType struct { } func (t *DecimalType) String() string { - return fmt.Sprintf("DECIMAL(%d,%d)", t.Scale, t.Precision) + // Matching parquet-cli's decimal string format: https://github.com/apache/parquet-mr/blob/d057b39d93014fe40f5067ee4a33621e65c91552/parquet-column/src/test/java/org/apache/parquet/parser/TestParquetParser.java#L249-L265 + return fmt.Sprintf("DECIMAL(%d,%d)", t.Precision, t.Scale) } // Time units for logical types. diff --git a/print_test.go b/print_test.go index eae2982..6f535f4 100644 --- a/print_test.go +++ b/print_test.go @@ -141,14 +141,14 @@ func TestPrintSchema(t *testing.T) { { node: parquet.Group{"cost": parquet.Decimal(0, 9, parquet.Int32Type)}, print: `message Test { - required int32 cost (DECIMAL(0,9)); + required int32 cost (DECIMAL(9,0)); }`, }, { node: parquet.Group{"cost": parquet.Decimal(0, 18, parquet.Int64Type)}, print: `message Test { - required int64 cost (DECIMAL(0,18)); + required int64 cost (DECIMAL(18,0)); }`, },