Skip to content

Support shared YQL expressions and implicit SELECT names - #44

Merged
asmyasnikov merged 4 commits into
mainfrom
codex/shared-yql-expressions
Sep 23, 2026
Merged

asmyasnikov merged 4 commits into
mainfrom
codex/shared-yql-expressions

Conversation

@asmyasnikov

@asmyasnikov asmyasnikov commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Reporting and filtering queries such as COUNT_IF(bio IS NOT NULL), CAST(COUNT(*) AS Bool), and name LIKE $prefix || "%"u now share the same typed expression rules as supported DML assignments. Computed SELECT outputs without AS receive YDB-compatible names and result ordering, including collisions and wildcard expansion.

Closes #31.

  • Add shared Boolean/comparison/concatenation resolution, verified scalar casts, and left-to-right COALESCE/NVL typing with exact fitting integer literals.
  • Add COUNT_IF, NANVL, UTC and timezone clock families, Random/RandomNumber/RandomUuid, and Version. The reference inventory distinguishes implemented signatures from remaining collection, lambda, type, resource, window, and SQL/JSON work; this PR does not claim complete YQL builtin coverage.
  • Add authors prefix search, conditional statistics and export metadata examples, regenerated for every language/runtime profile. Align jOOQ record coercion and ORDER BY alias references with resolved result metadata, including multiple sort keys. Cover mixed-type wildcard/name collisions using both the published SDKs and live YDB.
  • Derive Rust result comparison traits only when every field supports them in ydb 0.18.2. Byte fields retain equality without unsupported hash/ordering traits; nested optional results receive an explicit SDK decoding diagnostic.

Validation passed: make check, the complete Java generator suite with published SDK checks, the jOOQ examples Maven suite, strict TypeScript example compilation/build/import checks, the Rust SDK regression suite, and cargo test --locked for all Rust examples. Sequential execution against local YDB 26.3.1.16 passed through Go native, Go database/sql and Java jOOQ. The new live suite checks result metadata, NULL/empty aggregate behavior, narrowing and invalid-JSON boundaries, implicit names and wildcard normalization; CI runs it on stable and nightly images and includes its integration coverage.

All nine CI checks passed on 62089386. The final merged Codecov report covers every modified executable line (100% patch coverage) and reports 89.47% project line coverage, up from 88.55% on its coverage-bearing base 9f1a0af. Regression tests cover predicate diagnostics, wildcard/collision ordering and typed jOOQ output-alias sorting; stable CI executes the Go and jOOQ checks against YDB. Codecov line coverage is distinct from local Go statement coverage.

Implicit-name and type rules were checked against YDB source at 1415fed8104201c5e973dd8bbf12c71c6b1ed8b9; exact source and SDK evidence is recorded in the contributor documentation. Unsupported overloads and runtime result types retain actionable diagnostics.

@codecov-commenter

codecov-commenter commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.47%. Comparing base (9f1a0af) to head (6208938).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   88.55%   89.47%   +0.92%     
==========================================
  Files          59       63       +4     
  Lines       10237    10480     +243     
==========================================
+ Hits         9065     9377     +312     
+ Misses        675      631      -44     
+ Partials      497      472      -25     
Flag Coverage Δ
integration 40.01% <74.93%> (?)
unit 89.37% <100.00%> (+0.81%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/analyzer/boolean.go 100.00% <100.00%> (ø)
internal/analyzer/dml_expression.go 100.00% <ø> (ø)
internal/analyzer/expression.go 85.96% <100.00%> (+2.80%) ⬆️
internal/analyzer/insert_select.go 98.52% <100.00%> (+0.04%) ⬆️
internal/analyzer/literal.go 92.92% <100.00%> (+5.04%) ⬆️
internal/analyzer/order_by.go 100.00% <100.00%> (ø)
internal/analyzer/predicate.go 92.75% <100.00%> (+7.71%) ⬆️
internal/analyzer/projection_names.go 100.00% <100.00%> (ø)
internal/analyzer/select_semantic.go 87.77% <100.00%> (+0.74%) ⬆️
internal/analyzer/semantic.go 91.35% <100.00%> (+2.02%) ⬆️
... and 8 more

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34cced5...6208938. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docs/compatibility.md
Comment thread internal/analyzer/projection_names.go
Comment thread internal/analyzer/expression.go Outdated
@robot-vibe-db

robot-vibe-db Bot commented Sep 23, 2026

Copy link
Copy Markdown

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Minor | High: jOOQ generation cannot render ORDER BY by output aliases or implicit computed result names (unsupported jOOQ syntax "column1") although analysis accepts those queries, contradicting the documented compatibility claim — docs/compatibility.md:69
  • Minor | Medium: the wildcard + collision-shift shape that requires the lexical re-sort of result columns is not covered by the live YDB verification, so positional decoders rely on a wire-order assumption that was only confirmed without a wildcard — internal/analyzer/projection_names.go:48
  • Nit | High: the IN rejection message reads as a contradiction when it fires in HAVING, which is itself a predicate context; the previous wording named the rejected contexts explicitly — internal/analyzer/expression.go:103

The rest of the changes were reviewed without further actionable findings: shared YQL expression resolution (Boolean operators, comparisons, null checks, concatenation), implicit columnN result naming and wildcard normalization, the COALESCE/NVL fitting-literal reconciliation, the new CAST rules and built-in signatures, and the jOOQ/JDBC generator changes were checked against the YQL grammar, the offline resolver, the recorded live-YDB evidence and the regenerated examples. The added Rust derive fix matches the published-SDK trait evidence recorded in .agents/sdk-evidence.md. go build ./..., go vet ./... and the Go test suite pass on the current head, and make generate reproduces the committed examples without a diff; the Rust compiler round-trip tests fail only because rustc/rustfmt are unavailable in the review environment.


This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.

@robot-vibe-db

robot-vibe-db Bot commented Sep 23, 2026

Copy link
Copy Markdown

Full analysis log

Analysis performed by claude, z-ai/glm-5.3-flash.

@asmyasnikov
asmyasnikov merged commit 8229abc into main Sep 23, 2026
9 checks passed
@asmyasnikov
asmyasnikov deleted the codex/shared-yql-expressions branch September 23, 2026 12:55
@robot-vibe-db

robot-vibe-db Bot commented Sep 23, 2026

Copy link
Copy Markdown

Full analysis log

Analysis performed by claude, z-ai/glm-5.3-flash.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend shared Boolean expressions, conditional aggregates and scalar conversions

2 participants