Skip to content

Error with pre-aggregation and filters containing comma. #7287

@brice-baudry-trimble

Description

@brice-baudry-trimble

Describe the bug
When doing a query using pre-aggregation, an error is shown when doing a query with a filter like : dimension1 contains ',item1,'. Having the character comma (',') appears to be the problem

To Reproduce
Steps to reproduce the behavior:

  1. Create a cube that contains a pre aggregation
  2. Do a query that uses that pre-aggregation
  3. Add a filter to that query on any dimension, with a value that contains a comma. e.g
"filters": [
     {
        "member": "Event.groups",
        "operator": "contains",
        "values": [
          ",item1,"
        ]
      }
]
  1. See error

Expected behavior
Getting the result of that query, seeing only the filtered elements.
Instead, the following error can be seen :

Error: Internal: Execution error: Internal: Arrow error: External error: Arrow error: Compute error: Unable to build regex from LIKE pattern: regex parse error:
    ^.*\,item1\,.*$
       ^^
error: unrecognized escape sequence
    at QueryQueue.parseResult (node_modules\@cubejs-backend\query-orchestrator\src\orchestrator\QueryQueue.js:368:13)
    at QueryQueue.executeInQueue (node_modules\@cubejs-backend\query-orchestrator\src\orchestrator\QueryQueue.js:222:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at QueryCache.cachedQueryResult (node_modules\@cubejs-backend\query-orchestrator\src\orchestrator\QueryCache.ts:256:17)
    at QueryOrchestrator.fetchQuery (node_modules\@cubejs-backend\query-orchestrator\src\orchestrator\QueryOrchestrator.ts:302:20)
    at OrchestratorApi.executeQuery (node_modules\@cubejs-backend\server-core\src\core\OrchestratorApi.ts:98:20)
    at node_modules\@cubejs-backend\api-gateway\src\gateway.ts:1434:21
    at async Promise.all (index 0)
    at ApiGateway.getSqlResponseInternal (node_modules\@cubejs-backend\api-gateway\src\gateway.ts:1432:31)
    at node_modules\@cubejs-backend\api-gateway\src\gateway.ts:1610:28
    at async Promise.all (index 0)
    at ApiGateway.load (node_modules\@cubejs-backend\api-gateway\src\gateway.ts:1601:23)
    at node_modules\@cubejs-backend\api-gateway\src\gateway.ts:248:7
...
ERROR [cubestore::http] <pid:55712> Error processing HTTP command: Internal: Execution error: Internal: Arrow error: External error: Arrow error: Compute error: Unable to build regex from LIKE pattern: regex parse error:
    ^.*\,item1\,.*$
       ^^
error: unrecognized escape sequence

Version:
0.34.01

Additional context
When the query is not using a pre-aggregation, this is working fine. I couldn't find another character for which we have this issue, seems to be only ','.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions