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

Insert target columns empty fix #5079

Merged

Conversation

gruuya
Copy link
Contributor

@gruuya gruuya commented Jan 26, 2023

Which issue does this PR close?

Closes #5078.

Rationale for this change

Enable logical planning of INSERT statements without the optional target column list.

What changes are included in this PR?

If there are no parsed target fields in the INSERT statement default to using all the fields from the table's schema.

Are these changes tested?

Yes.

Are there any user-facing changes?

Only to users that use Datafusion as a framework where write statements are supported.

@github-actions github-actions bot added the sql SQL Planner label Jan 26, 2023
@gruuya gruuya force-pushed the insert-target-columns-empty-fix branch from 21e76c4 to a2f63cc Compare January 26, 2023 19:50
@@ -323,7 +323,7 @@ pub struct ConfigOptions {
pub catalog: CatalogOptions,
/// Execution options
pub execution: ExecutionOptions,
/// Explain options
/// Optimizer options
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ Nice drive by cleanup

@@ -165,13 +165,60 @@ fn plan_insert() {
"insert into person (id, first_name, last_name) values (1, 'Alan', 'Turing')";
let plan = r#"
Dml: op=[Insert] table=[person]
Projection: CAST(column1 AS id AS UInt32), column2 AS first_name, column3 AS last_name
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@alamb
Copy link
Contributor

alamb commented Jan 28, 2023

This makes sense to me -- thank you @gruuya

Copy link
Contributor

@avantgardnerio avantgardnerio left a comment

Choose a reason for hiding this comment

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

👍

@avantgardnerio avantgardnerio merged commit 3133526 into apache:master Jan 29, 2023
@ursabot
Copy link

ursabot commented Jan 29, 2023

Benchmark runs are scheduled for baseline = 842bda3 and contender = 3133526. 3133526 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INSERT statements without target column list are not working
4 participants