Skip to content

fix(jdbc): skip slash-only prefixes in optimized overlap queries#5029

Open
vigneshio wants to merge 1 commit into
apache:mainfrom
vigneshio:fix/jdbc-overlap-odd-root-prefixes
Open

fix(jdbc): skip slash-only prefixes in optimized overlap queries#5029
vigneshio wants to merge 1 commit into
apache:mainfrom
vigneshio:fix/jdbc-overlap-odd-root-prefixes

Conversation

@vigneshio

Copy link
Copy Markdown
Contributor

Fixes #5023.

Follow-up from the side note on #5003.

When building JDBC optimized location-overlap queries, scheme stripping turns paths like s3://bucket/tmp/location into //bucket/tmp/location. The prefix walk then emitted slash-only terms (/, //) that are not real storage locations.

Scheme stripping turns s3://bucket/path into //bucket/path, so the
prefix walk previously emitted / and // equality terms that are not
real storage locations. Skip slash-only prefixes when building the
overlap query. Same for file:/// paths that produced /// alone.

Fixes apache#5023
for (String component : components) {
pathBuilder.append(component).append("/");
String prefix = pathBuilder.toString();
// Skip "/", "//", "///", ... produced from empty path segments around the scheme separator.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The /// prefix is probably valid. It's the root dir in file: URIs, right?

}

@Test
void generateOverlapQueryDoesNotEmitSlashOnlyPrefixes() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: I don't see the coverage for a location without a trailing slash (e.g. s3://bucket/ns/t, IIUC, which is exactly where this and #5003 intersect. Worth a shared regression test once #5003 lands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Odd / and // paths in JDBC optimized location overlap checks

3 participants