Clean up YDB adapter internals and regression fixtures - #272
Merged
Merged
Conversation
Distinguish parameter groups from both operands and clarify the existing timestamp-literal fallback contract with an in-range control. All six expression tests pass. Temporary order and timestamp-pushdown mutations produced the three intended assertion failures, then were restored.
Inline the sole binary helper and use the unary rule pattern guarantees. Preserve divisor guards and parameter order, and exercise successful arithmetic/case rewrites alongside the existing fallback cases. Fresh package verification passes all 25 unit/API tests.
Keep native type admission and Decimal metadata handling while deleting branches excluded by the existing non-Decimal guard. Remove unused rewrite registrations and exercise Decimal writers through the actual client mapping. All 19 related mapping, JOIN and expression tests pass.
Pass the keys already checked by UPDATE to the RETURNING executor. DELETE still obtains its key metadata once after preparing the statement. Keep key-update rejection and exact RETURNING row counting unchanged. Compilation and six adjacent write/metadata/bootstrap tests pass; the full real-YDB CI remains the final DML behavior check.
Override only the fixture JdbcClient instead of copying production Guice bindings. Inline the empty metadata subclass while preserving the custom factory caching lifecycle and false policy argument. Both real connector bootstrap variants and the metadata regression pass.
Keep explicit hidden-key handling without mistaking a quoted column name for a table constraint. Add a failing-then-passing DDL regression and a real CREATE/INSERT/SELECT case for the full CI suite. Metadata/bootstrap tests pass, and all integration sources compile. Remove unused fixture imports and correct the stale INSERT staging comment.
Stage the plugin under the checked-in examples layout and use the Compose service for CLI access. Resolve the script directory and fail on errors. Real Maven packaging staged 79 JARs and the real Compose validator passed. Only Docker state-changing dispatch was intercepted during local QA.
YDB rejects spaces in column names even when quoted. Keep the synthetic DDL regression, assert the real invalid-name rejection, and exercise CREATE/INSERT/SELECT with the permitted primary_key identifier. The initial full CI exposed this incorrect new test expectation. All 27 local regressions and fresh packaging pass; full CI verifies both live cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Targeted cleanup approved after the independent maintainability review of #270.
This remains on Trino 483, based on main
94955bb; the separate 484 draft#271 is unchanged.
helper, unused type aliases and unreachable Decimal AVG registration.
RewriteUtils; use existing unary pattern guarantees.rejection, row counts or transaction ownership.
client; remove the empty metadata subclass while preserving the custom
factory's
falsepolicy and caching lifecycle.case for
primary key, assert YDB rejects this forbidden name, and exercisereal CREATE/INSERT/SELECT with the valid quoted name
primary_key.unsupported timestamp-literal contract and exercise both real bootstrap
variants and Decimal metadata mapping.
16 files changed: 167 insertions, 257 deletions. Two unnecessary classes removed.
Native type guards, JOIN semantics, MERGE resource/failure coverage, capabilities
and existing inherited suites remain intact. No tests are skipped to go green.
Verification
JDK: Temurin 25.0.2.
JAVA_HOME=$(/usr/libexec/java_home -v 25) mvn -B -ntp \ -f ydb-trino-adapter/pom.xml \ -Dtest=TestYdbExpressionRewrites,TestYdbColumnMappings,TestYdbJoinMappings,TestYdbMergeSink,TestYdbWriteMetadata,TestYdbPlugin \ clean verifyFinal local result: 27 passed, 0 failures/errors/skips, fresh package built.
All integration sources compile. The actual public connector factory starts
and shuts down for production and fixture module variants.
Regression evidence
admitted an in-range timestamp predicate: exactly the three intended tests
failed by assertion. Restored production code: all six then-current
expression tests passed. No mutation remains.
the same case passes after removing substring detection.
including TYPE_NAME precedence over generic JDBC precision/scale.
Example preparation
Executed the real
start.shand both real Maven commands. Only Dockerstate-changing commands were intercepted; the interceptor recorded their
working directory/arguments and invoked the real Compose config validator.
Old script failed because
docker/had no Compose file. Fixed script staged79 JARs under
examples/trino/plugin, validated the actual config andconfirmed service
trino.bash -n, Compose validation andgit diff --checkpass; the executable bit is preserved.
This proves packaging/config preparation, not running example containers.
Docker/Colima was not restarted or repaired. All temporary shims, staged JARs,
mutations and the unused worker worktree were removed.
Java/Bash language servers are unavailable; compiler and shell/Compose
validation were used. The pre-existing obsolete Compose
versionwarningremains. Local real-YDB execution requires the unavailable Colima daemon;
the ordinary full canonical CI is the final runtime gate.
Final full CI result
Run 36858049165
passed for exact head
49ebcb4d4363b71b986c96d22e73586e7f8ed838.Actions tested merge checkout
dd3931cagainst unchanged main94955bb.Temurin 25.0.4; ordinary workflow command in
ydb-trino-adapter:mvn $MAVEN_ARGS clean test.368 total, 283 passed, 85 skipped, 0 failures/errors; BUILD SUCCESS.
The 85 exclusions are unchanged from the baseline, not added by this cleanup.
Both final live identifier outcomes passed: quoted
primary_keyCREATE/INSERT/SELECT and exact rejection of the forbidden
primary key.Initial failure and correction
Run 36853742332
on
9570b6169afd0b549584ce190e1c947593c15f8f: 368 total, 282 passed,85 skipped, 1 error. The sole error is the newly added positive live test
for the column
primary key. YDB rejects spaces in column names even whenquoted:
Invalid name for user column 'primary key'. Its generated DDLcorrectly contains the hidden PK, so generator correctness and backend name
acceptance must be tested separately.
The documented naming rules
allow Latin letters, digits,
-and_, at most 255 characters, excluding thesystem prefix
__ydb_. The task owner approved correcting the mistaken newtest expectation. Commit
49ebcb4d4363b71b986c96d22e73586e7f8ed838preservesthe synthetic DDL regression, asserts the exact real rejection, and uses
quoted
primary_keyfor CREATE/INSERT/SELECT, with cleanup on all outcomes.All 27 local regressions, clean packaging and the final full CI pass.
No skip or name-remapping feature was introduced.
Review and delivery
The complete integrated diff was self-reviewed against the approved scope.
No new dependency, generic framework, type-support expansion, retry or
statement-atomic MERGE claim is introduced. An attempted isolated wiring
worker failed before execution; the primary agent implemented and verified
that work instead.
Final-head CI and recorded self-review are complete. Ready for review;
not merged and no automatic merge requested.