cube-js / cube

📊 Cube — The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.87k stars 1.77k forks source link

SQL API: Compute error in queries with OR operator #8417

Open kderbalah opened 3 months ago

kderbalah commented 3 months ago

Failed SQL

SELECT week_utc, MEASURE(num_customers) AS total_customers
FROM customers
WHERE month_utc = 202310 OR month_utc = 202311
GROUP BY week_utc

Error SQL Error [XX000]: ERROR: Arrow error: Compute error: TypeError: Cannot read properties of undefined (reading 'split')

Logical Plan

CubeScan: request={
  "measures": [
    "customers.num_customers"
  ],
  "dimensions": [
    "customers.week_utc"
  ],
  "segments": [],
  "filters": [
    {
      "or": [
        {
          "member": "customers.month_utc",
          "operator": "equals",
          "values": [
            "202310"
          ]
        },
        {
          "member": "customers.month_utc",
          "operator": "equals",
          "values": [
            "202311"
          ]
        }
      ]
    }
  ]
}

Version: v0.35.55

Additional context I see same error when enabling SQL pushdown

paveltiunov commented 3 months ago

@kderbalah This one most likely fails during query_rewrite

kderbalah commented 3 months ago

@paveltiunov I believe so, the query works fine without the OR operator, and the logical plan seems to be correct, what could be the issue?