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

Block `count(table.*)` to follow ANSI standard and other SQL engines

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersStop watchingWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.0
    • SQL
    • None

    Description

      In spark, the count(table.*) may cause very weird result, for example:

      select count from (select 1 as a, null as b) t;

      output: 1

      select count(t.*) from (select 1 as a, null as b) t;

      output: 0

       

      After checking the ANSI standard, count is always treated as count(1) while count(t.*) is not allowed. What's more, this is also not allowed by common databases, e.g. MySQL, oracle.

      Attachments

        Activity

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

          People

            linhongliu-db Linhong Liu Assign to me
            linhongliu-db Linhong Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment