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

New explicit cast syntax rules in ANSI mode

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • SQL
    • 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

            Gengliang.Wang Gengliang Wang
            Gengliang.Wang Gengliang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: