Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      Now, we trim the string when casting string value to those `canCast` types values, e.g. int, double, decimal, interval, date, timestamps, except for boolean.
      This behavior makes type cast and coercion inconsistency in Spark.
      Not fit ANSI SQL standard either.

      If TD is boolean, then
      Case:
      a) If SD is character string, then SV is replaced by
          TRIM ( BOTH ' ' FROM VE )
          Case:
          i) If the rules for literal in Subclause 5.3, “literal”, can be applied to SV to determine a valid
      value of the data type TD, then let TV be that value.
         ii) Otherwise, an exception condition is raised: data exception — invalid character value for cast.
      b) If SD is boolean, then TV is SV
      

      Attachments

        Issue Links

          Activity

            People

              Qin Yao Kent Yao 2
              Qin Yao Kent Yao 2
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: