risinglightdb / risinglight

An educational OLAP database system.
Apache License 2.0
1.59k stars 211 forks source link

feat/header: support set chunk header #818

Closed caicancai closed 9 months ago

caicancai commented 9 months ago

close: #817

2023-12-03 15-42-01屏幕截图

caicancai commented 9 months ago

LGTM. However, I don't think this is the best place to put this piece of code. Maybe we should move the match logic into the binder.

Besides, for select queries, resolving the header of their results is another challenging work. You can play with DuckDB to learn how it deals with this. Here are some examples:

D create table t(a int);
D select a from t;
┌────────┐
│   a    │
│ int32  │
├────────┤
│ 0 rows │
└────────┘
D select a + a from t;
┌─────────┐
│ (a + a) │
│  int32  │
├─────────┤
│ 0 rows  │
└─────────┘
D select 1+2;
┌─────────┐
│ (1 + 2) │
│  int32  │
├─────────┤
│       3 │
└─────────┘

You can see the header is determined by the expressions. Therefore, I think it is the binder that should be responsible for resolving headers.

Thank you for taking the time to reply to the review over the weekend, and I'll try to revise it later

caicancai commented 9 months ago

I might also want to try the select header, and then mention another PR

caicancai commented 9 months ago

tested 2023-12-03 23-09-29屏幕截图

caicancai commented 9 months ago

In the future, I may continue to expand binder_header, in order to select

caicancai commented 9 months ago

LGTM for now. Looking forward for the following improvement!

It's a great honor to complete this task

caicancai commented 9 months ago

@wangrunji0408 Recently, I have been busy with work. I may need to finish this part of work late. I am sorry for that

wangrunji0408 commented 9 months ago

@wangrunji0408 Recently, I have been busy with work. I may need to finish this part of work late. I am sorry for that

No hurry. Take your time.