Skip to content

Commit

Permalink
disable cte optimization for multi value druid dims (#5443)
Browse files Browse the repository at this point in the history
* disable cte optimization for multi value druid dims

* review comments

* review comments

* lint
  • Loading branch information
pjain1 committed Aug 27, 2024
1 parent da80772 commit 3321852
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtime/metricsview/executor_rewrite_approx_comparisons.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package metricsview

import (
"fmt"

"github.com/rilldata/rill/runtime/drivers"
)

// rewriteApproxComparisons rewrites the AST to use a LEFT or RIGHT join instead of a FULL joins for comparisons,
Expand Down Expand Up @@ -46,6 +48,12 @@ func (e *Executor) rewriteApproxComparisonNode(a *AST, n *SelectNode) bool {
}
sortField := a.Root.OrderBy[0]

// if there are unnests in the query, we can't rewrite the query for Druid
// it fails with join on cte having multi value dimension, issue - https://github.com/apache/druid/issues/16896
if e.olap.Dialect() == drivers.DialectDruid && len(a.unnests) > 0 {
return false
}

// Find out what we're sorting by
var sortDim, sortBase, sortComparison, sortDelta bool
var sortUnderlyingMeasure string
Expand Down

1 comment on commit 3321852

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://ui.rilldata.com as production
🚀 Deployed on https://66cdbe0d99b663ed651c705d--rill-ui.netlify.app

Please sign in to comment.