Skip to content

feat: support default value when inserting data#854

Merged
waynexia merged 1 commit intoGreptimeTeam:developfrom
lizhemingi:support-insert-default
Jan 13, 2023
Merged

feat: support default value when inserting data#854
waynexia merged 1 commit intoGreptimeTeam:developfrom
lizhemingi:support-insert-default

Conversation

@lizhemingi
Copy link
Copy Markdown
Contributor

@lizhemingi lizhemingi commented Jan 9, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

support default value when inserting data.

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Change Identifier without quoted to Placeholder instead of SingleQuotedString when inserting data.
  • Replace Placeholder with default and DEFAULT value to the default value of corresponding column if possible.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

image

Refer to a related PR or issue link (optional)

#759

@lizhemingi
Copy link
Copy Markdown
Contributor Author

@killme2008 PTAL.

Sorry for the slow progress, since I was suffering from covid-19 and busy work last few weeks.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 9, 2023

Codecov Report

Merging #854 (968a9da) into develop (6775c5b) will decrease coverage by 0.13%.
The diff coverage is 79.85%.

@@             Coverage Diff             @@
##           develop     #854      +/-   ##
===========================================
- Coverage    86.32%   86.18%   -0.14%     
===========================================
  Files          425      425              
  Lines        56097    56193      +96     
===========================================
+ Hits         48426    48431       +5     
- Misses        7671     7762      +91     
Flag Coverage Δ
rust 86.18% <79.85%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/datanode/src/error.rs 65.95% <0.00%> (-1.44%) ⬇️
src/frontend/src/error.rs 12.00% <0.00%> (-0.50%) ⬇️
src/sql/src/error.rs 80.64% <0.00%> (-1.33%) ⬇️
src/frontend/src/sql.rs 68.11% <54.54%> (-7.25%) ⬇️
src/datanode/src/sql/insert.rs 80.64% <57.14%> (-9.58%) ⬇️
src/sql/src/statements/insert.rs 79.54% <92.30%> (+9.17%) ⬆️
src/datatypes/src/schema/column_schema.rs 100.00% <100.00%> (ø)
src/sql/src/statements.rs 89.78% <100.00%> (+0.20%) ⬆️
src/object-store/src/test_util.rs 0.00% <0.00%> (-100.00%) ⬇️
src/datanode/src/instance.rs 50.00% <0.00%> (-15.87%) ⬇️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@killme2008
Copy link
Copy Markdown
Member

@killme2008 PTAL.

Sorry for the slow progress, since I was suffering from covid-19 and busy work last few weeks.

Wish you health. We'll review it ASAP. Thanks a lot.

Comment thread src/datanode/src/sql/insert.rs Outdated
Comment thread src/datanode/src/error.rs Outdated
Comment thread src/datanode/src/sql/insert.rs Outdated
Comment thread src/datanode/src/sql/insert.rs Outdated
Comment thread src/datanode/src/sql/insert.rs Outdated
Comment thread src/frontend/src/error.rs Outdated
Comment thread src/frontend/src/sql.rs
Comment thread src/sql/src/error.rs Outdated
Comment thread src/sql/src/statements.rs
Comment thread src/sql/src/statements/insert.rs
@lizhemingi lizhemingi force-pushed the support-insert-default branch from b3e223d to ba25788 Compare January 12, 2023 15:19
@lizhemingi lizhemingi force-pushed the support-insert-default branch from ba25788 to 968a9da Compare January 12, 2023 15:23
@lizhemingi
Copy link
Copy Markdown
Contributor Author

@killme2008 @killme2008 Please take another look.

Copy link
Copy Markdown
Member

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@killme2008 killme2008 requested a review from waynexia January 13, 2023 06:05
Copy link
Copy Markdown
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @lizhemingi. I'll add some cases to sqlness test to cover this change.

@waynexia waynexia merged commit 0959c1d into GreptimeTeam:develop Jan 13, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
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.

3 participants