Repository navigation
fix(oracle-driver): Build in-database pre-aggregations - #12601
waralexrom wants to merge 6 commits into
Conversation
The pre-aggregation CTAS reused the table-alias keyword, which Oracle leaves empty, so it was rendered without AS and Oracle rejected it. Before that, the build failed on information_schema catalog lookups that Oracle doesn't have; the driver now reads its own catalog for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @waralexrom's task in 1m 46s —— View job Review: the fix is correct; 2 high findings (data-loss risk in the new error message, missing Oracle docs). DetailsChecklist
Findings
Verified, no issues
Review threadsThe listing returned 0 prior threads from me, so nothing was resolved or re-affirmed. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #12601 +/- ##
===========================================
- Coverage 83.16% 66.18% -16.98%
===========================================
Files 531 258 -273
Lines 124731 21978 -102753
Branches 5290 5290
===========================================
- Hits 103730 14546 -89184
+ Misses 20206 6636 -13570
- Partials 795 796 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The missing-schema error pointed users at any existing schema, while builds drop every unrecognised table in it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Claude finished @waralexrom's task in 2m 6s —— View job Looks good to merge: 0 high, 0 medium, 2 low. Both prior threads are resolved. Review details
Findings (inline)
What I checked
Review threadsThe listing returned 2 of my own threads. I resolved both and re-affirmed none:
|
… schema A quoted mixed-case table came back lowercased, and the unquoted orphan drop could not find it, failing every build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @waralexrom's task in 1m 36s —— View job Looks good apart from one gap: the documented Oracle grant is missing Review details
Findings
Checked, no issue
Review threadsThe listing returned 2 of my prior threads. I resolved both, because the current diff addresses them: the |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @waralexrom's task in 1m 40s —— View job No issues found — 0 high, 0 medium, 0 low. 1 prior thread resolved. Review details
What I checked
Review threadsThe listing returned 1 of my own threads. I resolved it ( Not doneI couldn't check the CI status of this head because |
What was broken
A rollup with
external: falsecould not be built on Oracle:BaseQuery#preAggregationLoadSqlrendered the CTAS keyword fromasSyntaxTable.OracleQuerysets that to''because Oracle forbidsASbefore table aliases, so the load SQL came out asCREATE TABLE <name> SELECT ...and Oracle rejected it withORA-00922: missing or invalid option.createSchemaIfNotExistsandgetTablesQuery, which readinformation_schema.schemata/information_schema.tables. Oracle has neither (ORA-00942).The driver is
readOnly(), so external rollups go through Cube Store and never hit this path; only in-database rollups did.Fix
preAggregationLoadSqlalways emitsAS: in CTAS it is part of the statement, not an alias keyword. Every other dialect already renderedAShere, so their SQL is unchanged. The same code serves Tesseract and the legacy planner.OracleDriverreads its own catalog:createSchemaIfNotExistschecksall_usersand throws a clear error when the schema is missing (an Oracle schema is a user account, which a build can't create);getTablesQueryreadsall_tablesand lowercases names so they match the unquoted names Cube generates.Tests
New
must build an in-database pre-aggregationcase in the sharedtestQueriessuite, enabled fororacle-fullthrough a newincludeInDatabasePreAggregationSuiteoption. It buildsECommerce.SAInternalin Oracle, reads the built table back with the raw driver and checks its rows against the same query answered through the API.Pre-aggregation builds drop every table in their schema that they don't recognise, so the Oracle fixture now gets a dedicated
test_preaggsschema from an init script, withCUBEJS_PRE_AGGREGATIONS_SCHEMApointing at it.Run locally against
gvenzl/oracle-free:23-slim-faststart(yarn oracle-full --mode=local):ORA-00922.Fixes #3127
🤖 Generated with Claude Code