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

Binary comparison behavior should refer to Teradata

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.0
    • None
    • SQL
    • None

    Description

      The main difference is:

      1. When comparing a StringType value with a NumericType value, Spark converts the StringType data to a NumericType value. But Teradata converts the StringType data to a DoubleType value.
      2. When comparing a StringType value with a DateType value, Spark converts the DateType data to a StringType value. But Teradata converts the StringType data to a DateType value.
         

      More details:
      https://github.com/apache/spark/blob/65a4bc143ab5dc2ced589dc107bbafa8a7290931/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala#L120-L149
      https://www.info.teradata.com/HTMLPubs/DB_TTU_16_00/index.html#page/SQL_Reference/B035-1145-160K/lrn1472241011038.html

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yumwang Yuming Wang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: