feat(core): a DDL statement can succeed with a warning (R1FIX.8) - #192
Merged
Conversation
`DdlResult` gains `warnings: Seq[String] = Nil` so an operation that completed in a degraded mode can say so. The motivating case is `CREATE MATERIALIZED VIEW … JOIN …` on a cluster whose licence does not include Watcher: the view exists and is queryable, only the scheduled refresh is missing, so failing the statement would discard real work — but succeeding silently is worse, because the joined data then goes stale with nobody told. - `ResultRenderer` prints one⚠️ line per warning below the outcome line. - `JsonFormatter` emits a `warnings` array, omitted entirely when empty so existing consumers see no new key. - `ElasticDockerTestKit` gains `xpackLicenseType` (default "trial"). The licence type was hard-coded inside a private def, which is why no test in any repository had ever run against a cluster that declines a feature. - Docs: state what CREATE MATERIALIZED VIEW actually does on a Basic cluster. README held a fifth copy of the unverified "Platinum / Enterprise" tier claim — replaced with a link to Elastic's subscription matrix, because this project's own docs have disagreed about which tier first includes Watcher. Additive and default-valued, following QueryRows.truncation (P0.5): every existing constructor call keeps compiling. Positional pattern matches do not — `softclient4es-jdbc` pins the same mutable snapshot and is fixed in its own PR; `softclient4es-arrow` pins the released 0.20.2 and must fix ElasticFlightProducer.scala:845/:851 whenever it repins. Note the change is also binary-incompatible (apply/unapply signatures move), so any jar built against the old core needs recompiling rather than merely relinking. 722 core + 395 sql tests, 11 new, `+ compile` and the lint gate green. build.sbt:23 verify-only at 0.20.3-SNAPSHOT. Nothing published. Refs SOFTNETWORK-APP/softclient4es-extensions#49
fupelaqu
marked this pull request as ready for review
August 3, 2026 15:34
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.
Story R1FIX.8 (epic r1-defect-closure) — the upstream half.
A DDL statement can now succeed in a degraded mode and say so. The motivating case is
CREATE MATERIALIZED VIEW … JOIN …on an Elasticsearch cluster whose licence does not include Watcher: the view is created and queryable, only the scheduled refresh is missing, so failing the statement would discard real work — but silently succeeding is worse, because the joined data then goes stale with nobody told.What changed
DdlResult(success: Boolean, warnings: Seq[String] = Nil)— additive and default-valued, exactly the shapeQueryRows.truncationestablished in Story P0.5.ResultRendererprints one⚠️line per warning below the outcome line — the statement succeeded; the caveat is secondary.JsonFormatteremits awarningsarray, and omits the key entirely when empty so existing consumers see no new key.ElasticDockerTestKitgainslazy val xpackLicenseType: String = "trial". The licence type was previously hard-coded inside aprivate def, which is why no test in any repository had ever run against a cluster that declines a feature.documentation/sql/materialized_views.mdnow states whatCREATE MATERIALIZED VIEWactually does on a Basic cluster (succeeds, with a warning, andREFRESH MATERIALIZED VIEWalways works).README.mdheld a fifth copy of the unverified "Platinum / Enterprise" tier claim — corrected to link Elastic's subscription matrix rather than name a tier, because this repo's own docs have disagreed about which tier first includes Watcher.Adding a defaulted field to a case class is not source-compatible for positional pattern matches: the synthetic extractor's arity changes. Audited across the ecosystem:
coreDdlResult(…)matchesResultRenderer:60,JsonFormatter:560.20.3-SNAPSHOTExtensionsIntegrationSpec×40.20.3-SNAPSHOTElasticStatement.scala:346, :3790.20.2(released)ElasticFlightProducer.scala:845, :851Verification
ResultRendererSpec+ newJsonFormatterSpec11/11 ·core/test722 ·sql/test395 ·+ compile(2.12 + 2.13) ·headerCheck scalafmtSbtCheck scalafmtCheck test:scalafmtCheck— all green.build.sbt:23is verify-only (0.20.3-SNAPSHOT, unchanged). Nothing was published.Docs mirror: softclient4es-web PR (same story) —
feedback_dual_docs_sync.🤖 Generated with Claude Code