Skip to content

feat: impl insert data from query#1025

Merged
MichaelScofield merged 13 commits intoGreptimeTeam:developfrom
killme2008:feature/insert-select
Feb 17, 2023
Merged

feat: impl insert data from query#1025
MichaelScofield merged 13 commits intoGreptimeTeam:developfrom
killme2008:feature/insert-select

Conversation

@killme2008
Copy link
Copy Markdown
Member

@killme2008 killme2008 commented Feb 16, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Supports inserting data which is queried by a select statement.

For example:

insert into monitor2 select * from monitor;

insert into monitor2(host,ts,memory) select host,ts,memory from monitor;

After this feature is implemented, we can begin to implement inserting data from files such as CSV, parquet etc.I will create another PR to cover this feature in sqlness test.

Checklist

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

Refer to a related PR or issue link (optional)

Close #760

@killme2008 killme2008 changed the title Feature/insert select feat: impl insert data from query Feb 16, 2023
@killme2008 killme2008 force-pushed the feature/insert-select branch from 6f270be to e2c9682 Compare February 16, 2023 14:28
@killme2008 killme2008 marked this pull request as ready for review February 17, 2023 01:17
@killme2008 killme2008 requested review from MichaelScofield, evenyag and v0y4g3r and removed request for MichaelScofield and v0y4g3r February 17, 2023 01:17
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 17, 2023

Codecov Report

Merging #1025 (a44da9b) into develop (16f86a9) will decrease coverage by 0.09%.
The diff coverage is 87.71%.

@@             Coverage Diff             @@
##           develop    #1025      +/-   ##
===========================================
- Coverage    86.02%   85.94%   -0.09%     
===========================================
  Files          437      439       +2     
  Lines        63432    63871     +439     
===========================================
+ Hits         54568    54892     +324     
- Misses        8864     8979     +115     
Flag Coverage Δ
rust 85.94% <87.71%> (-0.09%) ⬇️

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

Impacted Files Coverage Δ
src/datatypes/src/vectors/constant.rs 80.14% <0.00%> (-3.06%) ⬇️
src/sql/src/lib.rs 100.00% <ø> (ø)
src/datatypes/src/vectors/operations.rs 81.35% <35.29%> (-18.65%) ⬇️
src/datanode/src/instance/sql.rs 80.34% <82.35%> (-0.51%) ⬇️
src/datanode/src/sql.rs 79.12% <82.92%> (+0.55%) ⬆️
src/datanode/src/sql/insert.rs 82.06% <84.28%> (+1.21%) ⬆️
src/sql/src/statements/insert.rs 81.37% <91.66%> (+2.63%) ⬆️
src/datatypes/src/vectors/operations/cast.rs 100.00% <100.00%> (ø)
src/frontend/src/sql.rs 72.15% <100.00%> (+1.09%) ⬆️
src/object-store/src/test_util.rs 0.00% <0.00%> (-100.00%) ⬇️
... and 18 more

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

Comment thread src/datatypes/src/error.rs
Comment thread src/datanode/src/sql/insert.rs Outdated
Comment thread src/datanode/src/sql/insert.rs
Comment thread src/datanode/src/sql/insert.rs Outdated
Copy link
Copy Markdown
Member

@sunng87 sunng87 left a comment

Choose a reason for hiding this comment

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

Add @shuiyisong , please verify if this can bypass our cross-schema access check, for both insert and select

Comment thread src/datanode/src/sql/insert.rs Outdated
@sunng87 sunng87 requested a review from shuiyisong February 17, 2023 06:14
@killme2008
Copy link
Copy Markdown
Member Author

@MichaelScofield MichaelScofield merged commit a9c8584 into GreptimeTeam:develop Feb 17, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: refactor insertion in datanode

* feat: supports inserting data by select query

* feat: impl cast operation for vector

* feat: streaming insert from select query results

* chore: minor changes

* fix: remove unwrap

* test: insert_to_requsts

* test: test_execute_insert_by_select

* fix: cast operation for vectors

* fix: test

* fix: typo

* chore: by CR comments

* fix: test_statement_to_request
@killme2008 killme2008 deleted the feature/insert-select branch January 16, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category Enhancements docs-required This change requires docs update.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supports INSERT INTO SELECT statement

4 participants