Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(type): unify DataTypeKind #708

Merged
merged 6 commits into from
Oct 13, 2022
Merged

refactor(type): unify DataTypeKind #708

merged 6 commits into from
Oct 13, 2022

Conversation

wangrunji0408
Copy link
Member

Currently we use both sqlparser::ast::DataType and PhysicalDataTypeKind to describe data types. They are a little duplicative. The former definition is a little verbose for our usage. And DataType doesn't implement PartialOrd & Ord traits, preventing us from putting it into the egg expression.

So this PR unifies the above two types into a new DataTypeKind, which only defines the type we used, and has all necessary traits like Ord, Hash, Display, and FromStr.

With this type, this PR enables type cast in the constant folding. Next step, we can implement type check in the new planner.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 enabled auto-merge (squash) October 13, 2022 18:49
@wangrunji0408 wangrunji0408 merged commit 384aa6b into main Oct 13, 2022
@wangrunji0408 wangrunji0408 deleted the wrj/datatype branch October 13, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants