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

Fix issue when compare string and IntegerType

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • SQL
    • None

    Description

      When we comparing a String Type and IntegerType:
      '2147483648'(StringType, which exceed Int.MaxValue) > 0(IntegerType).

      Now the result of findCommonTypeForBinaryComparison(StringType, IntegerType) is IntegerType.

      But the value of string may exceed Int.MaxValue, then the result is corruputed.

      For example:

      // Some comments here
      CREATE TEMPORARY VIEW ta AS SELECT * FROM VALUES(CAST ('2147483648' AS STRING))  AS ta(id);
      SELECT * FROM ta WHERE id > 0; // result is null
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hzfeiwang feiwang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: