You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/10/08 16:50:50 UTC

[GitHub] [pinot] elonazoulay opened a new issue #7546: Query with grouping columns but no aggregate ignores column aliases

elonazoulay opened a new issue #7546:
URL: https://github.com/apache/pinot/issues/7546


   If a query has grouping columns but no aggregates the aliases are ignored.
   To reproduce start the quick start batch and run the following query:
   ```
   select AtBatting as foo, baseOnBalls as bar from baseballStats 
   group by AtBatting, baseOnBalls
   limit 10
   ```
   Result uses `AtBatting` and `baseOnBalls` instead of `foo`, `bar`
   
   If an aggregate is added then the aliases are correct:
   ```
   select AtBatting as foo, baseOnBalls as bar , count(*) from baseballStats 
   group by AtBatting, baseOnBalls
   limit 10
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 edited a comment on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
xiangfu0 edited a comment on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956982292






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-955896428


   @xiangfu0 @elonazoulay Can you please verify the fix and close the issue if the issue is fixed?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
xiangfu0 commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956982292


   > I've just tested after compiling Pinot from master, and the issue still exists.
   > 
   > ```sql
   > SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   > FROM calcs
   > GROUP BY 1
   > ```
   > 
   > ```json
   > {
   >   "resultTable": {
   >     "dataSchema": {
   >       "columnNames": [
   >         "cast(int1,'FLOAT')"
   >       ],
   >       "columnDataTypes": [
   >         "FLOAT"
   >       ]
   >     }, ...
   > ```
   
   The issue here is that in `NonAggregationGroupByToDistinctQueryRewriter.java`, Pinot rewrite this query
   ```SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   to
   ```SELECT DISTINCT calcs.int1
   FROM calcs
   ```
   And it loses the alias information.
   @Jackie-Jiang 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-965785069


   Fixed by #7678 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] SandishKumarHN commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
SandishKumarHN commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-940232713


   working on it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 edited a comment on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
xiangfu0 edited a comment on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956982292


   > I've just tested after compiling Pinot from master, and the issue still exists.
   > 
   > ```sql
   > SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   > FROM calcs
   > GROUP BY 1
   > ```
   > 
   > ```json
   > {
   >   "resultTable": {
   >     "dataSchema": {
   >       "columnNames": [
   >         "cast(int1,'FLOAT')"
   >       ],
   >       "columnDataTypes": [
   >         "FLOAT"
   >       ]
   >     }, ...
   > ```
   
   The issue is in `NonAggregationGroupByToDistinctQueryRewriter.java`.
   Pinot rewrites this query
   ```SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   to
   ```SELECT DISTINCT calcs.int1
   FROM calcs
   ```
   And it loses the alias information.
   @Jackie-Jiang 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 edited a comment on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
xiangfu0 edited a comment on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956982292






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
xiangfu0 commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956982292


   > I've just tested after compiling Pinot from master, and the issue still exists.
   > 
   > ```sql
   > SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   > FROM calcs
   > GROUP BY 1
   > ```
   > 
   > ```json
   > {
   >   "resultTable": {
   >     "dataSchema": {
   >       "columnNames": [
   >         "cast(int1,'FLOAT')"
   >       ],
   >       "columnDataTypes": [
   >         "FLOAT"
   >       ]
   >     }, ...
   > ```
   
   The issue here is that in `NonAggregationGroupByToDistinctQueryRewriter.java`, Pinot rewrite this query
   ```SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   to
   ```SELECT DISTINCT calcs.int1
   FROM calcs
   ```
   And it loses the alias information.
   @Jackie-Jiang 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 edited a comment on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
xiangfu0 edited a comment on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956982292


   > I've just tested after compiling Pinot from master, and the issue still exists.
   > 
   > ```sql
   > SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   > FROM calcs
   > GROUP BY 1
   > ```
   > 
   > ```json
   > {
   >   "resultTable": {
   >     "dataSchema": {
   >       "columnNames": [
   >         "cast(int1,'FLOAT')"
   >       ],
   >       "columnDataTypes": [
   >         "FLOAT"
   >       ]
   >     }, ...
   > ```
   
   The issue is in `NonAggregationGroupByToDistinctQueryRewriter.java`.
   Pinot rewrites this query:
   
   ```
   SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   to
   ```
   SELECT DISTINCT calcs.int1
   FROM calcs
   ```
   And it loses the alias information.
   @Jackie-Jiang 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang closed issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang closed issue #7546:
URL: https://github.com/apache/pinot/issues/7546


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] SandishKumarHN commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
SandishKumarHN commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-955894514


   the issues is fixed as part of this PR https://github.com/apache/pinot/pull/7576/, just verified it. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
xiangfu0 commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956982292


   > I've just tested after compiling Pinot from master, and the issue still exists.
   > 
   > ```sql
   > SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   > FROM calcs
   > GROUP BY 1
   > ```
   > 
   > ```json
   > {
   >   "resultTable": {
   >     "dataSchema": {
   >       "columnNames": [
   >         "cast(int1,'FLOAT')"
   >       ],
   >       "columnDataTypes": [
   >         "FLOAT"
   >       ]
   >     }, ...
   > ```
   
   The issue here is that in `NonAggregationGroupByToDistinctQueryRewriter.java`, Pinot rewrite this query
   ```SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   to
   ```SELECT DISTINCT calcs.int1
   FROM calcs
   ```
   And it loses the alias information.
   @Jackie-Jiang 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] kbastani commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
kbastani commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-964370280


   @xiangfu0 @Jackie-Jiang Do we have an update on this fix?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] kbastani commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
kbastani commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956836463


   I've just tested after compiling Pinot from master, and the issue still exists. 
   
   ```sql
   SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   
   ```json
   {
     "resultTable": {
       "dataSchema": {
         "columnNames": [
           "cast(int1,'FLOAT')"
         ],
         "columnDataTypes": [
           "FLOAT"
         ]
       }, ...
    ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] kbastani commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
kbastani commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956836463


   I've just tested after compiling Pinot from master, and the issue still exists. 
   
   ```sql
   SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   
   ```json
   {
     "resultTable": {
       "dataSchema": {
         "columnNames": [
           "cast(int1,'FLOAT')"
         ],
         "columnDataTypes": [
           "FLOAT"
         ]
       }, ...
    ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] kbastani commented on issue #7546: Query with grouping columns but no aggregate ignores column aliases

Posted by GitBox <gi...@apache.org>.
kbastani commented on issue #7546:
URL: https://github.com/apache/pinot/issues/7546#issuecomment-956836463


   I've just tested after compiling Pinot from master, and the issue still exists. 
   
   ```sql
   SELECT CAST(calcs.int1 AS FLOAT) AS TEMP_Test__3817907367__0_
   FROM calcs
   GROUP BY 1
   ```
   
   ```json
   {
     "resultTable": {
       "dataSchema": {
         "columnNames": [
           "cast(int1,'FLOAT')"
         ],
         "columnDataTypes": [
           "FLOAT"
         ]
       }, ...
    ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org