diff --git a/src/Parquet.Test/DecimalTypeTest.cs b/src/Parquet.Test/DecimalTypeTest.cs index ad598326..4367c745 100644 --- a/src/Parquet.Test/DecimalTypeTest.cs +++ b/src/Parquet.Test/DecimalTypeTest.cs @@ -44,7 +44,7 @@ public void Validate_Scale_Bigger_Then_Precision_Throws_Exception() { const int precision = 3; const int scale = 4; ArgumentException ex = Assert.Throws(() => new DecimalDataField("field-name", precision, scale)); - Assert.Equal("scale must be less than the precision (Parameter 'scale')", ex.Message); + Assert.Equal("scale must be less than or equal to the precision (Parameter 'scale')", ex.Message); } } } \ No newline at end of file diff --git a/src/Parquet/Schema/DecimalDataField.cs b/src/Parquet/Schema/DecimalDataField.cs index 5bee46f2..cb81046a 100644 --- a/src/Parquet/Schema/DecimalDataField.cs +++ b/src/Parquet/Schema/DecimalDataField.cs @@ -41,8 +41,8 @@ public DecimalDataField(string name, throw new ArgumentException("precision is required and must be a non-zero positive integer", nameof(precision)); if(scale < 0) throw new ArgumentException("scale must be zero or a positive integer", nameof(scale)); - if(scale >= precision) - throw new ArgumentException("scale must be less than the precision", nameof(scale)); + if(scale > precision) + throw new ArgumentException("scale must be less than or equal to the precision", nameof(scale)); Precision = precision; Scale = scale;