Github user maropu commented on the issue:

    https://github.com/apache/spark/pull/17191
  
    @gatorsmile How about this? It seems we have the same behaviour;
    
    ```
    // PostgreSQL
    postgres=# select gkey1 AS "2", gkey2, count(value) from t2 group by "2", 2;
     2 | gkey2 | count 
    ---+-------+-------
     1 |     1 |     1
    (1 row)
    
    
    // MySQL
    mysql> select gkey1 AS `2`, gkey2, count(value) from t2 group by `2`, 2;
    +------+-------+--------------+
    | 2    | gkey2 | count(value) |
    +------+-------+--------------+
    |    1 |     1 |            1 |
    +------+-------+--------------+
    1 row in set (0.00 sec)
    
    // Spark
    scala> Seq((1, 1, 1)).toDF("key1", "key2", 
"value").createOrReplaceTempView("t")
    scala> val df = sql("SELECT key1 AS `2`, key2, COUNT(value) FROM t GROUP BY 
`2`, 2")
    scala> df.show
    +---+----+------------+
    |  2|key2|count(value)|
    +---+----+------------+
    |  1|   1|           1|
    +---+----+------------+
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to