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

Projection feature doesn't work #62680

Open
gogodjzhu opened this issue Apr 16, 2024 · 2 comments
Open

Projection feature doesn't work #62680

gogodjzhu opened this issue Apr 16, 2024 · 2 comments

Comments

@gogodjzhu
Copy link

Cluster version: 23.3.9.55

when I follow this doc to test projection feature. system.query_log show that none projection was used.

sql:

CREATE TABLE visits_order
(
    `user_id` UInt64,
    `user_name` String,
    `pages_visited` Nullable(Float64),
    `user_agent` String
)
    ENGINE = MergeTree()
        PRIMARY KEY user_agent;

ALTER TABLE visits_order ADD PROJECTION user_name_projection (
    SELECT
        *
    ORDER BY user_name
    );

ALTER TABLE visits_order MATERIALIZE PROJECTION user_name_projection;

INSERT INTO visits_order SELECT
                             number,
                             'test',
                             1.5 * (number / 2),
                             'Android'
FROM numbers(1, 100000);

SELECT
    *
FROM visits_order
WHERE user_name='test'
LIMIT 2;

select projections from system.query_log where query_id = 'c5780554-39ee-44e3-aac3-7deab35b2991';
-- ┌─projections─┐
-- │ []          │
-- │ []          │
-- └─────────────┘
@nickitat
Copy link
Member

example should be refined

@den-crane
Copy link
Contributor

23.3.9.55 -- out of support

fixed

v23.7.1.2470-stable.md:* Add back missing projection QueryAccessInfo when query_plan_optimize_projection = 1. This fixes #50183 . This fixes #50093 . #52327 (Amos Bird).

duplicate #50183 #50093

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

No branches or pull requests

3 participants