Skip to content

Conversation

@jonahgao
Copy link
Member

Which issue does this PR close?

Closes #8091.

Rationale for this change

If user does not provide a value for certain columns during insertion, NULL will be filled as their default values.

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Nov 13, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @jonahgao -- it looks really nice to me as always.

cc @avantgardnerio

)
} else {
let mut mapping = vec![None; table_schema.fields().len()];
let mut value_indices = vec![None; table_schema.fields().len()];
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the new name value_indicies much better

Values: (Int64(1), Utf8("Alan"), Utf8("Turing"))
"#
.trim();
let plan = "Dml: op=[Insert Into] table=[person]\
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@alamb alamb merged commit 64057fd into apache:main Nov 14, 2023
@alamb
Copy link
Contributor

alamb commented Nov 14, 2023

Thanks @jonahgao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

INSERT INTO does not allow to insert only specified columns

2 participants