Skip to content

bug: Hilbert recluster get parser error #18903

@zhyass

Description

@zhyass

Summary

root@localhost:8000/default> create table t(a string, b int);
0 row written in 0.185 sec. Processed 0 row, 0 B (0 row/s, 0 B/s)

root@localhost:8000/default> alter table t cluster by hilbert(substring(a,1,5),b);
0 row written in 0.077 sec. Processed 0 row, 0 B (0 row/s, 0 B/s)

root@localhost:8000/default> insert into t values('a',1);
┌─────────────────────────┐
│ number of rows inserted │
│          UInt64         │
├─────────────────────────┤
│                       1 │
└─────────────────────────┘
1 row written in 0.109 sec. Processed 1 row, 22 B (9.17 rows/s, 201 B/s)

root@localhost:8000/default> insert into t values('b',2),('c',3);
┌─────────────────────────┐
│ number of rows inserted │
│          UInt64         │
├─────────────────────────┤
│                       2 │
└─────────────────────────┘
2 rows written in 0.091 sec. Processed 2 rows, 42 B (21.98 rows/s, 461 B/s)

root@localhost:8000/default> alter table t recluster;
error: APIError: QueryFailed: [1005]error: 
  --> SQL:1:66
  |
1 | SELECT range_bound(1000, 1000)(hilbert_range_index(t.SUBSTRING(a FROM 1 FOR 5), [], t.b, [])) FROM default.t
  | ------ -----------            --------------------            -  ^^^^ expecting `IS`, `IN`, `LIKE`, `EXISTS`, `BETWEEN`, `+`, `-`, `*`, `/`, `//`, `DIV`, `%`, `||`, `<=>`, `<+>`, `<->`, `>`, `<`, `>=`, `<=`, `=`, `<>`, `!=`, `^`, `AND`, `OR`, `XOR`, `NOT`, `REGEXP`, `RLIKE`, `SOUNDS`, or more ...
  | |      |                      ||                              |   
  | |      |                      ||                              while parsing `(<expr> [, ...])`
  | |      |                      |while parsing `function(... [ , x -> ... ] ) [ (...) ] [ WITHIN GROUP ( ORDER BY <expr>, ... ) ] [ OVER ([ PARTITION BY <expr>, ... ] [ ORDER BY <expr>, ... ] [ <window frame> ]) ]`
  | |      |                      while parsing `(<expr> [, ...])`
  | |      while parsing expression
  | while parsing `SELECT ...`

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