fix(core): handle the unnest table factor for the specific dialect#1104
fix(core): handle the unnest table factor for the specific dialect#1104douenergy merged 2 commits intoCanner:mainfrom
Conversation
WalkthroughThe changes introduce a new method Changes
Sequence Diagram(s)sequenceDiagram
participant T as Test Client
participant WD as WrenDialect
participant ID as InnerDialect (BigQueryDialect)
T->>WD: unnest_as_table_factor()
WD->>ID: Delegate the call
ID-->>WD: Return true (BigQuery-specific)
WD-->>T: Return true
sequenceDiagram
participant Test as Async Test
participant SC as SessionContext
participant MB as ManifestBuilder
participant SA as SQL Analyzer
Test->>SC: Create session context
Test->>MB: Build manifest (default & BigQuery)
MB->>SA: Analyze manifest to generate SQL
SA-->>Test: Return SQL query with proper unnest transformation
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| let analyzed_mdl = Arc::new(AnalyzedWrenMDL::analyze(manifest)?); | ||
| let sql = "select * from unnest([1, 2, 3])"; | ||
| let actual = transform_sql_with_ctx(&ctx, analyzed_mdl, &[], sql).await?; | ||
| assert_eq!(actual, "SELECT \"UNNEST(make_array(Int64(1),Int64(2),Int64(3)))\" FROM UNNEST([1, 2, 3])"); |
There was a problem hiding this comment.
It's not a valid SQL for BigQuery actually. See apache/datafusion#15233
douenergy
left a comment
There was a problem hiding this comment.
LTGM , Thanks @goldmedal
Description
unnest_as_table_factoris required for the specific dialect only (e.g. BigQuery). We should enable it for BigQuery only.Summary by CodeRabbit
New Features
Tests