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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.0.1, 1.1.0
    • SQL
    • 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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment