Repository navigation
All tables support the _table virtual column - #63665
alexey-milovidov merged 20 commits into
Conversation
8ee3e19 to
ea30421
Compare
|
This is an automated comment for commit d0a272e with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
a4b8d09 to
c9cbc27
Compare
|
Hi @alexey-milovidov |
c9cbc27 to
85fc5ac
Compare
85fc5ac to
a6f74aa
Compare
|
Hi, @wudidapaopao. I would be glad to review your feature. Could you, please, merge master? |
a6f74aa to
ae287c2
Compare
Hi, @divanik. I have refreshed the code and I would like to express my sincere gratitude for your thorough review. |
There was a problem hiding this comment.
Could you, please, explain why this behavior is a desired one and we do not want to see m1 here?
There was a problem hiding this comment.
Currently, the _table virtual column is only supported for tables with the Merge engine.
The behavior is such that when querying a table using the Merge engine, the _table virtual column returns the actual names of the underlying tables that the Merge table aggregates data from, rather than returning the name of the Merge table itself. And this PR extends this virtual column to all tables.
https://clickhouse.com/docs/en/engines/table-engines/special/merge#virtual-columns
There was a problem hiding this comment.
Let's make it always to be the inner-most table.
It will break the current behavior when a Merge table is created on top of more Merge tables, but it will be ok.
There was a problem hiding this comment.
I'd like if the breaking change is a separate PR.
There was a problem hiding this comment.
Name should reflect connection with _table column
There was a problem hiding this comment.
I've relocated this logic to the common AddingTableNameVirtualColumnStep.cpp file and add "TableName" to the function's name to elucidate its functionality.
There was a problem hiding this comment.
Rename "extractRequiredColumnsFromStorage" to "extractRequiredNonTableColumnsFromStorage"
There was a problem hiding this comment.
For distributed tables, it's special as the table name needed for projection has been transformed into a constant column. Therefore, there's no requirement to add an AddingTableNameVirtualColumnStep subsequently, which is why the return value here is false.
41ffaff to
497aa2f
Compare
Hi, @divanik. I greatly appreciate the review feedback provided. I have incorporated documentation within the "Documentation entry for user-facing changes" subsection. Is there a necessity to add documentation in any other sections? |
ee19f35 to
bdabc6d
Compare
|
I think, that you can put the content from Documentation entry for user-facing changes as you can write. Could you please remove it from this PR (I think that CI thinks that documentation is not written because there is no change in docs/ folder)? |
|
Hi, @divanik. I moved the content of the document in PR to docs/en/engines/table-engines/index.md. |
|
Hi @divanik @KochetovNicolai, based on the previous feedback, I have added tests for VIEW, MATERIALIZED VIEW, and Buffer types. For MATERIALIZED VIEW and Buffer tables, it directly returns the MATERIALIZED VIEW table name and Buffer table name, respectively. For VIEW, it returns the initial table name. Please let me know if there are any inaccuracies, and I will make the necessary adjustments promptly. |
|
Hi @wudidapaopao, I’ve decided to implement this feature myself to address our design discussions internally. I plan to make the PR it within this or next week and will invite you to review the pull request once it's ready. |
|
Dear @divanik, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
|
Workflow [PR], commit [2dd0076] Summary: ❌
|
|
Hi @wudidapaopao @alexey-milovidov — while reviewing this PR I found the following:
Happy to discuss — close anything that's wrong or already addressed. |
Fixes #60300
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Not only for Merge tables, but all tables support the _table virtual column
Documentation entry for user-facing changes
Modify your CI run
NOTE: If your merge the PR with modified CI you MUST KNOW what you are doing
NOTE: Checked options will be applied if set before CI RunConfig/PrepareRunConfig step
Include tests (required builds will be added automatically):
Exclude tests:
Extra options:
Only specified batches in multi-batch jobs:
Details