Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27764 Feature Parity between PostgreSQL and Spark
  3. SPARK-28429

SQL Datetime util function being casted to double instead of timestamp

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • SQL
    • None

    Description

      In the code below, 'now()+'100 days' are casted to double and then an error is thrown:

      CREATE TEMP VIEW v_window AS
      SELECT i, min(i) over (order by i range between '1 day' preceding and '10 days' following) as min_i
      FROM range(now(), now()+'100 days', '1 hour') i;
      

      Error:

      cannot resolve '(current_timestamp() + CAST('100 days' AS DOUBLE))' due to data type mismatch: differing      types in '(current_timestamp() + CAST('100 days' AS DOUBLE))' (timestamp and double).;

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              DylanGuedes Dylan Guedes
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: