Trino - Optimize visibility filtering using Iceberg metadata - #10837
andresdantereng wants to merge 11 commits into
Conversation
|
|
| @@ -0,0 +1,205 @@ | |||
| /*********************************************************************** | |||
There was a problem hiding this comment.
IcebergVisibilityPruningMechanismTest's tests cover only emptyAuthsDomain and tokenDomain. There is no expressionDomain case at all. Worth adding:
- A file with
__vis__ = "admin&ops"survives underexpressionDomain({"admin&ops"}, {"admin","ops"})where tokenDomain prunes it. This is the entire justification for the PR and is currently only asserted at the Domain level (expressionDomainFixesTokenDomainsCompoundExpressionGap), never through the manifest evaluator.
|
Edge case (unlikely to occur in prod, but should be fixed): The isVisible UDF treats empty vis entries ("" \ length() == 0) as unrestricted, so the code anticipates "" occurring in the column. But parseVisibilityExpressions drops blank entries, so "" can never be declared; the domain admits NULL only. If any row carries "" rather than NULL, files holding only empty |
|
could you add the new properties to |
If it simplifies things, I think we could just assume that if vis are being used, then no vis are empty/null - in practice, if vis are enabled then it is likely to be an error if a vis is empty/null. in other stores, we actually have a sys prop to enforce setting vis at write time - we may want to add that to trino as well. |
c9c4d33 to
8ac5c84
Compare
This is also done, but let me know if I added too much documentation. |
Done |
Ok, after offline discussion, we are going to fail-closed on rows with null/empty vis, when a vis column is present and visibility filtering is flagged as enabled, so we would 1) return no rows lacking an empty vis, and thus 2) prune out any files whose contents contain solely empty/null vis |
…e-visibility-filtering-using-iceberg-metadata
| <skipITs>true</skipITs> | ||
| <opentelemetry.version>1.65.0</opentelemetry.version> <!-- note: trino bundles 1.61.0, but that triggers a CVE in our scanning --> | ||
| <!-- The geomesa parent pins jetty to 9.4 for its own server stack, but Trino 483's | ||
| embedded test HTTP server (DistributedQueryRunner, used only by the end-to-end |
There was a problem hiding this comment.
this is ok for now, but we should prefer using trino through testcontainers instead of embedded test frameworks, for the very reason that embedded frameworks complicate the classpath and don't always accurately reflect a real instance. (we have an example in TrinoDataStoreTest of using testcontainers)
There was a problem hiding this comment.
actually, I didn't realize the test framework was being added in this PR - I think we should switch to using testcontainers instead.
There was a problem hiding this comment.
you could move the IT into the trino data store module, or otherwise you'll just need to make sure that the plugin is packaged and available to load into the trino image when the tests run - i.e. just make sure the maven lifecycle is correct.
There was a problem hiding this comment.
Sounds like moving the IT into the Trino datastore module is the right thing to do. I definitely chose the wrong path on this one. The changes have been pushed, but I'm seeing errors when I run it locally, so I'm not out of the woods on this one yet. I'll update when I have dealt with all the issues.
There was a problem hiding this comment.
This should be okay now. I was consistently able to run this:
mvn -pl geomesa-trino/geomesa-trino-datastore -am verify \
-DskipITs=false \
-Dit.test=VisibilityPruningEndToEndIT \
-Dtest=NONE \
-Dsurefire.failIfNoSpecifiedTests=false \
-Dfailsafe.failIfNoSpecifiedTests=false
|
looks like there are test failures in CI, also |
This optimizes filtering based on visibility values by filtering Iceberg files based on visibility min-max values in metadata. Two new properties are required:
closes #10818