XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.0
    • None
    • SQL
    • None

    Description

      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)]

      Attachments

        Activity

          People

            Unassigned Unassigned
            abhishek.akg ABHISHEK KUMAR GUPTA
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: