akshayjain3450 commented on issue #7420: URL: https://github.com/apache/iceberg/issues/7420#issuecomment-1527300023
I do not have the formal definition, but spark-sql tries to conform with ANSI compliance if you enable this property: spark.sql.ansi.enabled=true. With this property: I have these results: scala> DecimalType(0,0) res3: org.apache.spark.sql.types.DecimalType = DecimalType(0,0) as mentioned by @RussellSpitzer scala> DecimalType(2,3) org.apache.spark.sql.AnalysisException: Decimal scale (3) cannot be greater than precision (2). scala> DecimalType(2, -3) org.apache.spark.SparkException: [INTERNAL_ERROR] Negative scale is not allowed: -3. Set the config "spark.sql.legacy.allowNegativeScaleOfDecimal" to "true" to allow it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
