incubator-gluten
incubator-gluten copied to clipboard
[CH-45]Support count(1)/count(*)
Relate to the issue https://github.com/Kyligence/ClickHouse/issues/45
What changes were proposed in this pull request?
A empty base_schema will be made in the scan
node when run the following queries
select count(1) from t;
select count(*) from t;
select sum(2) from t;
select 1 from t;
The backend source node will return empty data or throw an exception when there is no column to read.
So we fill a attribute to read in FileSourceScanExec
.
Another problem is in ProjectExecTransformer
. If ProjectExecTransformer
's child is an ColumnarInputAdapter
and projectList
is empty, it would generate a scan node with empty base_schema. So when childCtx
is null, we don't return directly.
How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
Thanks for opening a pull request!
Could you open an issue for this pull request on Github Issues?
https://github.com/oap-project/gluten/issues
Then could you also rename commit message and pull request title in the following format?
[Gluten-${ISSUES_ID}] ${detailed message}
See also:
Please rebase to main and add some UTs
Please rebase to main
wait for https://github.com/Kyligence/ClickHouse/pull/175 be merged