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

Minor: Simplify IdentTaker #13609

Merged
merged 1 commit into from
Dec 1, 2024
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Nov 30, 2024

Which issue does this PR close?

Follow on to #13605

Rationale for this change

As suggested by @jonahgao on https://github.com/apache/datafusion/pull/13605/files#r1863695929

Not related to the current PR, maybe we can move IdentNormalizer into IdentTaker to simplify take() and avoid creating normalizer every time.

What changes are included in this PR?

  1. Move IdentNormalizer into IdentTaker

Are these changes tested?

Yes, by CI

Are there any user-facing changes?

No, these are all internal apis

@github-actions github-actions bot added the sql SQL Planner label Nov 30, 2024
@@ -622,21 +622,37 @@ pub fn object_name_to_table_reference(
idents_to_table_reference(idents, enable_normalization)
}

struct IdentTaker(Vec<Ident>);
struct IdentTaker {
normalizer: IdentNormalizer,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the point of the PR is to move normalizer into IdentTaker so it isn't created again on each row

@alamb alamb changed the title Minor: Simplify IdentTaker Minor: Simplify IdentTaker Nov 30, 2024
Copy link
Member

@jonahgao jonahgao left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @alamb

}

/// Returns the number of remaining identifiers
fn len(&self) -> usize {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@Weijun-H Weijun-H left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @alamb

@Weijun-H Weijun-H merged commit 172e557 into apache:main Dec 1, 2024
26 checks passed
@Weijun-H
Copy link
Member

Weijun-H commented Dec 1, 2024

Thanks @jonahgao for reviewing

@alamb alamb deleted the alamb/simple_ident_taker branch December 2, 2024 12:14
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.

3 participants