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

adding config to control Varchar behavior #11090

Merged
merged 12 commits into from
Jun 28, 2024
Merged

Conversation

Lordworms
Copy link
Contributor

Which issue does this PR close?

Closes #10743

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added sql SQL Planner core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jun 23, 2024
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.

Looks good to me -- thank you @Lordworms

I had a suggestion for a different parameter name, but I don't think that is required

datafusion/sql/src/planner.rs Outdated Show resolved Hide resolved
/// type with a specified length. This can be useful for enforcing certain schema
/// constraints or maintaining compatibility with systems that do not support
/// length-specified `Varchar` types.
pub error_on_varchar_with_length: bool, default = false
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be easier to understand to avoid the double negative here

So perhaps the config flag could be support_varchar_with_length and default to true 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, I'll fix it

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.

Thanks again @Lordworms

I tweaked the config documentation a little and added a new test.

This looks great

@alamb alamb merged commit ca9c322 into apache:main Jun 28, 2024
24 checks passed
comphead pushed a commit to comphead/arrow-datafusion that referenced this pull request Jul 2, 2024
* adding config to control Varchar behavior

* fix failed tests

* fix config_md

* format md

* optimize code

* format md

* format md

* adding config

* Tweak documentation

* Update sqllogictest

* tweaks strings

---------

Co-authored-by: Andrew Lamb <[email protected]>
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* adding config to control Varchar behavior

* fix failed tests

* fix config_md

* format md

* optimize code

* format md

* format md

* adding config

* Tweak documentation

* Update sqllogictest

* tweaks strings

---------

Co-authored-by: Andrew Lamb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Precision/length parameter of varchar/char types is ignored
2 participants