Repository navigation
Fix Doris overwrite metadata registration and routing - #7
Merged
Merged
Conversation
Signed-off-by: jiangxt2 <[email protected]>
Signed-off-by: jiangxt2 <[email protected]>
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.
Pull request
What changes were proposed in this pull request?
Honor generic and Doris-specific overwrite requests using the active SparkSession configuration, and reject conflicting targets before registration or preparation.
Bound task identities to 256 Unicode characters while preserving persisted legacy identities that already fit.
Store complete selectors and predicates as TEXT, provide a data-preserving migration, refresh retry payloads, and reject failed metadata queries or missing state updates.
Add redacted stage, SQLSTATE, length, and timing diagnostics; preserve primary failures when cleanup or failure recording also fails.
Align CI policy expectations with 18 Doris cases and 35 cases across domain shards.
Why are the changes needed?
Eight comma-separated dates occupy 71 characters, exceeding the original 64-character metadata column. Combined task identities can exceed the 256-character key. Partial configuration, session settings read through SparkContext, and generic overwrite routed through JDBC can also leave writes without the requested metadata coordination.
Related issues
Fixes #6.
Does this PR introduce any user-facing change?
Yes. Generic overwrite now uses atomic connector replacement even for small or forced-JDBC outputs. The output path must match the configured Doris database/table; unqualified names resolve within that database. Completely absent metadata remains optional, but partial configuration and required metadata failures are errors. An explicitly configured empty password remains valid. JDBC append behavior is unchanged.
Existing stores must widen
rdateandpartition_filterbefore writing values beyond their legacy limits:Use controlled PostgreSQL connection environment variables and a maintenance window for the table lock. The migration preserves task records, indexes, triggers, and foreign keys; it is not applied automatically. If metadata fails after publication, reconcile the target before retrying.
How was this patch tested?
Baseline: JDK 17.0.18, Scala 2.12.18, Spark 3.5.8, Maven 3.9.5, PostgreSQL 16.14, and native ARM64 Doris 3.0.6.2.
mvn -B -pl pista-connector -am test -DmembersOnlySuites=com.pista.spark.sql.doris.meta,com.pista.spark.sql.connector.doris,com.pista.spark.sql.connector.doris.batch.scripts/run_domain_it.sh doris.mvn -B -pl pista-connector -am test -DmembersOnlySuites=com.pista.spark.sql.connector.doris -DtagsToInclude=com.pista.DorisOverwriteBoundaryIT -Dpista.it.exclude.tag=__pista_it_no_exclude__— 3/3 passed, with no failed, skipped, canceled, or ignored cases.python -m pytest scripts/tests -q— 33 policy cases passed;ruff format --check scriptsandruff check scriptspassed with Python 3.12, pytest 9.1.1, and Ruff 0.14.14.python3 -B scripts/check_public_content.py,python3 -B scripts/check_language.py,python3 -B scripts/check_markdown.py,python3 -B scripts/check_public_license.py, andgit diff --checkpassed.The verified target baseline is Doris 3.0.6.2 with PostgreSQL 16.14; this change does not establish additional recovery or cross-target consistency guarantees.