jayzhan211 commented on issue #12023:
URL: https://github.com/apache/datafusion/issues/12023#issuecomment-2292414939
I check the behaviour from Duckdb and Postgres, it is not the same as what
Spark SQL is
```
D create table t(a int);
D insert into t values(1);
D insert into t values(2);
D select count(a < 0) from t;
┌────────────────┐
│ count((a < 0)) │
│ int64 │
├────────────────┤
│ 2 │
└────────────────┘
```
```
postgres=# create table t(a int);
CREATE TABLE
postgres=# insert into t values (1);
INSERT 0 1
postgres=# insert into t values (2);
INSERT 0 1
postgres=# select count(a > 10) from t;
count
-------
2
(1 row)
```
Given the behaviour is consistent with both Duckdb and Postgres. I suggest
we leave the function alone, but instead
1. Write the spark-compatible count function downstream
2. Bring spark-compatible functions to datafusion
3. Configure count function so the user could choose what dialect to use
(Postgres, DuckDB or Spark or others)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]