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

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

    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

          People

            linhongliu-db Linhong Liu
            linhongliu-db Linhong Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: