databend icon indicating copy to clipboard operation
databend copied to clipboard

feat(planner): support tuple map access pushdown to storage

Open b41sh opened this issue 2 years ago • 1 comments

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Use map access syntax to select tuple inner columns and push down the query to the storage layer, only need to read the required columns.

  1. ColumnEntry add field path_indices as an index to find inner columns.
  2. add tuple inner columns to Metadata.
  3. modify the Extras field projection as enum Projection in order to access inner columns.

for example

CREATE TABLE t(id Int, t Tuple(a Tuple(m Int64, n Int64), b Tuple(x Int64, y Int64))) Engine = Fuse;
INSERT INTO t (id, t) VALUES(1, ((10, 11), (20, 21))), (2, ((30, 31), (40, 41)));
SELECT t:a:m, t:a:n, t:b[0], t:b[1] FROM t;

+-------+-------+--------+--------+
| t:a:m | t:a:n | t:b[0] | t:b[1] |
+-------+-------+--------+--------+
| 10    | 11    | 20     | 21     |
| 30    | 31    | 40     | 41     |
+-------+-------+--------+--------+

Fixes #6794

b41sh avatar Aug 11 '22 05:08 b41sh

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
databend ✅ Ready (Inspect) Visit Preview Aug 12, 2022 at 2:54PM (UTC)

vercel[bot] avatar Aug 11 '22 05:08 vercel[bot]

@mergify update

BohuTANG avatar Aug 12 '22 14:08 BohuTANG

update

✅ Branch has been successfully updated

mergify[bot] avatar Aug 12 '22 14:08 mergify[bot]