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

Update SPLIT_PART scalar function to support Utf8View #11975

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

Lordworms
Copy link
Contributor

Which issue does this PR close?

Closes #11950

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 sqllogictest SQL Logic Tests (.slt) functions labels Aug 14, 2024
@Lordworms
Copy link
Contributor Author

an unrelated ci fail

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 @Lordworms -- I left some suggestions but I also think this PR could be merged in as is. Love to see the code 🚋 carrying on

Ok(Some(split_string[index]))
} else {
Ok(Some(""))
match (args[0].data_type(), args[1].data_type()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

split_part is one of the functions where we could actually use StringViewArray to speed up its implementation (by avoiding a string copy). This function as written will copy the parts along

It might be a fun optimization project to try as a follow on

}
}
}

macro_rules! process_split_part {
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW I think we could make this macro a generic function with ArrayAccessor like in this pR from @PsiACE #11974

@alamb alamb merged commit c1fb989 into apache:main Aug 15, 2024
24 checks passed
@alamb
Copy link
Contributor

alamb commented Aug 15, 2024

Thanks again @Lordworms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update SPLIT_PART scalar function to support Utf8View
2 participants