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

Type coercion for IN is not coherent between Literals and subquery

Rank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.3.0
    • None
    • SQL

    Description

      The IN statement can have a different behavior according to whether there is a list of literals or a subquery, because the type coercion works differently in the two cases.

      This means, that these two equivalent queries return different results:

      select 1 from (select 1) a where 1 in ('01'); // this returns an empty dataset
      select 1 from (select 1) a where 1 in (select '01' from (select 1)); // returns 1 row
      

      Attachments

        Issue Links

        Activity

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

          People

            Unassigned Unassigned
            mgaido Marco Gaido
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment