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

New explicit cast syntax rules in ANSI mode

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      In section 6.13 of the ANSI SQL standard, there are syntax rules for valid combinations of the source and target data types.
      To make Spark's ANSI mode more ANSI SQL Compatible´╝îI propose to disallow the following casting in ANSI mode:

      TimeStamp <=> Boolean
      Date <=> Boolean
      Numeric <=> Timestamp
      Numeric <=> Date
      Numeric <=> Binary
      String <=> Array
      String <=> Map
      String <=> Struct
      

      The following castings are considered invalid in ANSI SQL standard, but they are quite straight forward. Let's Allow them for now

      Numeric <=> Boolean
      String <=> Boolean
      String <=> Binary
      

        Attachments

          Activity

            People

            • Assignee:
              Gengliang.Wang Gengliang Wang
              Reporter:
              Gengliang.Wang Gengliang Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: