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

Type conversion does not make sense under case like select ’0.1’ = 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.0.0
    • None
    • SQL
    • None

    Description

      SQL select '0.1' = 0 returns true. The result seems unreasonable.

      From the logical plan, the sql is parsed as 'Project (cast(cast(0.1 as decimal(20,0)) as int) = 0) AS #6'. The type conversion converts the string to integer, which leads to the unreasonable result.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Shaoquan Zhang Shaoquan Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: