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

date_trunc Spark SQL function silently returns null if parameters are swapped

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.3.0, 2.3.1
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: