-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
ISSUES-117 add show create & exist temporary table #1901
Conversation
dd5a1f1
to
0ed6846
Compare
@alexey-milovidov Maybe you can review this first? because it's already half in master |
14d56f7
to
0126118
Compare
b5dcefd
to
361a220
Compare
Sorry for the delay. We will review today. |
Looks like it will be much better to implement this feature through |
@@ -538,7 +538,7 @@ BlockIO InterpreterCreateQuery::createTable(ASTCreateQuery & create) | |||
false); | |||
|
|||
if (create.is_temporary) | |||
context.getSessionContext().addExternalTable(table_name, res); | |||
context.getSessionContext().addExternalTable(table_name, res, query_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After CREATE ... AS SELECT
queries you will have SELECT
part present in the result of SHOW CREATE
query. This goes in contrast with results of SHOW CREATE
queries for ordinary tables: databases don't store the SELECT
part and don't show it in SHOW CREATE
.
@@ -239,6 +243,7 @@ class Context | |||
|
|||
/// Get query for the CREATE table. | |||
ASTPtr getCreateQuery(const String & database_name, const String & table_name) const; | |||
ASTPtr getCreateExternalQuery(const String & table_name) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name looks strange. This is because we have a mess with "temporary" and "external" tables.
Ok for now, but I would like to split "temporary" and "external" tables.
I wonder what is the main motivation of this feature (what is your usage scenario, where this is most important)? |
Sorry, we don't need it, I just solve a few issue during the holiday, hoping to help you : ) |
Your help is very appreciated! |
#117
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en