Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-25686

date_trunc Spark SQL function silently returns null if parameters are swapped

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.3.0, 2.3.1
    • None
    • SQL
    • None

    Description

      date_trunc(a_timestamp, 'minute') returns null

      date_trunc('minute', a_timestamp) returns a valid timestamp

      it would be nice to have a runtime error to help catch the problem

      This was not helped by the fact that the doc examples had it swapped, but yes I should have tested our use of it more thoroughly

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zebehringer Zack Behringer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: