You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/19 05:22:36 UTC

[GitHub] [arrow-datafusion] HaoYang670 opened a new issue, #3891: `count(Literal)` gives wrong column name

HaoYang670 opened a new issue, #3891:
URL: https://github.com/apache/arrow-datafusion/issues/3891

   **Describe the bug**
   A clear and concise description of what the bug is.
   
   **To Reproduce**
   Tested on the latest datafusion-cli
   ```sql
   ❯ select count(2.2);
   +-----------------+
   | COUNT(UInt8(1)) |
   +-----------------+
   | 1               |
   +-----------------+
   ```
   **Expected behavior**
   I'd like the column name to be
   ```
   COUNT(Float64(2.2))
   ```
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] alamb closed issue #3891: `count(Literal)` gives wrong column name

Posted by GitBox <gi...@apache.org>.
alamb closed issue #3891: `count(Literal)` gives wrong column name
URL: https://github.com/apache/arrow-datafusion/issues/3891


-- 
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: github-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] HaoYang670 commented on issue #3891: `count(Literal)` gives wrong column name

Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on issue #3891:
URL: https://github.com/apache/arrow-datafusion/issues/3891#issuecomment-1284818587

   Hi @andygrove, I guess this bug is probably related to the sql-parser. Because there is no error when constructing the expression directly:
   ```rust
       #[test]
       fn my_test() -> Result<()> {
           let expr = count(lit(2.2));
           let expected = "COUNT(Float64(2.2))";
           assert_eq!(expected, expr.display_name()?);
           Ok(())
       }
   ```


-- 
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: github-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] comphead commented on issue #3891: `count(Literal)` gives wrong column name

Posted by GitBox <gi...@apache.org>.
comphead commented on issue #3891:
URL: https://github.com/apache/arrow-datafusion/issues/3891#issuecomment-1285814649

   There is a hardcoded value in `COUNT_STAR_EXPANSION` that expands to `pub const COUNT_STAR_EXPANSION: ScalarValue = ScalarValue::UInt8(Some(1));`, @andygrove should we fixed this as above?


-- 
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: github-unsubscribe@arrow.apache.org

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