You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Aman Omer (Jira)" <ji...@apache.org> on 2019/11/11 14:15:00 UTC

[jira] [Commented] (SPARK-29849) Spark trunc() func does not support for number group as PostgreSQL

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

Aman Omer commented on SPARK-29849:
-----------------------------------

I am checking this issue.

> Spark trunc() func does not support for number group as PostgreSQL
> ------------------------------------------------------------------
>
>                 Key: SPARK-29849
>                 URL: https://issues.apache.org/jira/browse/SPARK-29849
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: ABHISHEK KUMAR GUPTA
>            Priority: Minor
>
> PostgreSQL trunc() function accepts number group as below
> SELECT trunc(1234567891.1234567891,4);
> output
> |1|1234567891,1234|
> Spark does not accept
> jdbc:hive2://10.18.19.208:23040/default> SELECT trunc(1234567891.1234567891D,4);
> Error: org.apache.spark.sql.AnalysisException: cannot resolve 'trunc(1.2345678911234567E9D, CAST(4 AS STRING))' due to data type mismatch: argument 1 requires date type, however, '1.2345678911234567E9D' is of double type.; line 1 pos 7;
> 'Project [unresolvedalias(trunc(1.2345678911234567E9, cast(4 as string)), None)]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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