Yuming Wang created SPARK-28322:
-----------------------------------
Summary: DIV support decimal type
Key: SPARK-28322
URL: https://issues.apache.org/jira/browse/SPARK-28322
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 3.0.0
Reporter: Yuming Wang
Spark SQL:
{code:sql}
spark-sql> SELECT DIV(CAST(10 AS DECIMAL), CAST(3 AS DECIMAL));
Error in query: cannot resolve '(CAST(10 AS DECIMAL(10,0)) div CAST(3 AS
DECIMAL(10,0)))' due to data type mismatch: '(CAST(10 AS DECIMAL(10,0)) div
CAST(3 AS DECIMAL(10,0)))' requires integral type, not decimal(10,0); line 1
pos 7;
'Project [unresolvedalias((cast(10 as decimal(10,0)) div cast(3 as
decimal(10,0))), None)]
+- OneRowRelation
{code}
PostgreSQL:
{code:sql}
postgres=# SELECT DIV(CAST(10 AS DECIMAL), CAST(3 AS DECIMAL));
div
-----
3
(1 row)
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]