Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support sort key, add ORDER BY grammar to assign sort key. #11733

Closed
Linkerist opened this issue Sep 28, 2022 · 0 comments · Fixed by #11734
Closed

[Feature] Support sort key, add ORDER BY grammar to assign sort key. #11733

Linkerist opened this issue Sep 28, 2022 · 0 comments · Fixed by #11734

Comments

@Linkerist
Copy link
Contributor

Feature request

Is your feature request related to a problem? Please describe.

now sort key is primary key, can not assign non-key columns.
it's ok:

CREATE TABLE test (
  `k1` int,
  `k2` int,
  `k3` int,
  `v1` int,
  `v2` int,
  `v3` int,
  `v4` int,
  `v5` int
) ENGINE=OLAP
PRIMARY KEY(`k1`, `k2`, `k3`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`k1`, `k2`, `k3`) BUCKETS 1
PROPERTIES ("replication_num" = "1");

it's not ok:

CREATE TABLE test (
  `k1` int,
  `k2` int,
  `k3` int,
  `v1` int,
  `v2` int,
  `v3` int,
  `v4` int,
  `v5` int
) ENGINE=OLAP
PRIMARY KEY(`k1`, `k2`, `k3`)
ORDER BY(`v2`, `v4`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`k1`, `k2`, `k3`) BUCKETS 1
PROPERTIES ("replication_num" = "1");

need to support the latter.

Describe the solution you'd like

add ORDER BY grammar, and use the assigned columns to sort, and do some adaptive things for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant