You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2023/01/31 09:21:00 UTC

[jira] [Commented] (SPARK-42251) Forbid deicmal type if precision less than 1

    [ https://issues.apache.org/jira/browse/SPARK-42251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17682456#comment-17682456 ] 

Apache Spark commented on SPARK-42251:
--------------------------------------

User 'ulysses-you' has created a pull request for this issue:
https://github.com/apache/spark/pull/39822

> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org