[ 
https://issues.apache.org/jira/browse/SPARK-42251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

XiDuo You updated SPARK-42251:
------------------------------
    Summary: Forbid deicmal type if precision less than 1  (was: Forbid deicmal 
type if precision is 0)

> Forbid deicmal type if precision less than 1
> --------------------------------------------
>
>                 Key: SPARK-42251
>                 URL: https://issues.apache.org/jira/browse/SPARK-42251
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.5.0
>            Reporter: XiDuo You
>            Priority: Major
>
> Spark does not actually support decimal type with 0 precision. e.g.
>  
> {code:java}
> – work with in-memory catalog
> create table t (c decimal(0, 0)) using parquet;
> -- fail with parquet
> -- java.lang.IllegalArgumentException: Invalid DECIMAL precision: 0
> -- at org.apache.parquet.Preconditions.checkArgument(Preconditions.java:57)
> insert into table t values(0);
> -- fail with hive catalog
> -- Caused by: java.lang.IllegalArgumentException: Decimal precision out of 
> allowed range [1,38]
> -- at 
> org.apache.hadoop.hive.serde2.typeinfo.HiveDecimalUtils.validateParameter(HiveDecimalUtils.java:44)
> create table t (c decimal(0, 0)) using parquet;{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to