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

cast to boolean on boolean value gets turned into NOT((boolean_condition) = 0)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.1, 1.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      explain select cast(cast(key=0 as boolean) as boolean) aaa from src
      

      should be

      [Physical execution plan:]
      [Project [(key#10:0 = 0) AS aaa#7]]
      [ HiveTableScan [key#10], (MetastoreRelation default, src, None), None]
      

      However, it is currently

      [Physical execution plan:]
      [Project [NOT((key#10=0) = 0) AS aaa#7]]
      [ HiveTableScan [key#10], (MetastoreRelation default, src, None), None]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rxin Reynold Xin
                Reporter:
                rxin Reynold Xin
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: