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

Table functions are run before errors could be found during query analysis #63497

Closed
alexey-milovidov opened this issue May 8, 2024 · 3 comments

Comments

@alexey-milovidov
Copy link
Member

Use case

milovidov-pc :) SELECT trace, count() FROM url('https://s3.amazonaws.com/clickhouse-test-reports/60468/92ebf3d5becdf7af2bc17e3afb479fd456f008c1/stress_test__debug_/trace_log.tsv.zst') WHERE trace_type = 'Real'

SELECT
    trace,
    count()
FROM url('https://s3.amazonaws.com/clickhouse-test-reports/60468/92ebf3d5becdf7af2bc17e3afb479fd456f008c1/stress_test__debug_/trace_log.tsv.zst')
WHERE trace_type = 'Real'

Query id: eb093bad-9439-425e-949c-6e74f74e40db


Elapsed: 1.039 sec. 

Received exception:
Code: 215. DB::Exception: Column trace is not under aggregate function and not in GROUP BY keys. In query SELECT trace, count() FROM url('https://s3.amazonaws.com/clickhouse-test-reports/60468/92ebf3d5becdf7af2bc17e3afb479fd456f008c1/stress_test__debug_/trace_log.tsv.zst') WHERE trace_type = 'Real'. (NOT_AN_AGGREGATE)

Wasted one second.

@JackyWoo
Copy link
Contributor

JackyWoo commented May 8, 2024

hi alexey, I wandor whether the elapsed 1 second is caused by reading schema of the tsv file but not real execution.

@alexey-milovidov
Copy link
Member Author

Yes, very likely.

@JackyWoo
Copy link
Contributor

JackyWoo commented May 9, 2024

I debugged the sql and found that there is only schema reading (actually 2 rows ) but no execution in query analysis stage.

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

2 participants