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

fix(type): add NULL type and fix type analysis #721

Merged
merged 2 commits into from
Oct 31, 2022
Merged

fix(type): add NULL type and fix type analysis #721

merged 2 commits into from
Oct 31, 2022

Conversation

wangrunji0408
Copy link
Member

This PR adds a NULL variant to the DataTypeKind enum, as the type of NULL value. And fixes the remaining failed tests in type analysis.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 requested a review from skyzh October 31, 2022 09:46
@skyzh
Copy link
Member

skyzh commented Oct 31, 2022

In general NULL should be part of the type itself (e.g., int null, varchar null) instead of a separate data type kind? Though I'm okay with this change.

@wangrunji0408
Copy link
Member Author

In general NULL should be part of the type itself (e.g., int null, varchar null) instead of a separate data type kind?

Do you mean "nullable"? (e.g. int nullable, varchar not nullable)

The null type in this PR means an "unknown" type for a single NULL value. Previously we represent this by a None in Option<DataType>, and now it will be DataType { kind: Null, nullable: true }.

@skyzh
Copy link
Member

skyzh commented Oct 31, 2022

Oh that seems fine!

Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@skyzh skyzh merged commit 508e85a into main Oct 31, 2022
@skyzh skyzh deleted the wrj/type branch October 31, 2022 17:42
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.

2 participants