You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "XiDuo You (Jira)" <ji...@apache.org> on 2023/01/31 09:18:00 UTC
[jira] [Updated] (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: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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org