| 2068 | |
| 2069 | |
| 2070 | StoragePtr Context::executeTableFunction(const ASTPtr & table_expression) |
| 2071 | { |
| 2072 | /// Slightly suboptimal. |
| 2073 | auto hash = table_expression->getTreeHash(); |
| 2074 | String key = toString(hash.first) + '_' + toString(hash.second); |
| 2075 | |
| 2076 | StoragePtr & res = table_function_results[key]; |
| 2077 | |
| 2078 | if (!res) |
| 2079 | { |
| 2080 | TableFunctionPtr table_function_ptr = TableFunctionFactory::instance().get(table_expression, shared_from_this()); |
| 2081 | |
| 2082 | /// Run it and remember the result |
| 2083 | res = table_function_ptr->execute(table_expression, shared_from_this(), table_function_ptr->getName()); |
| 2084 | } |
| 2085 | |
| 2086 | return res; |
| 2087 | } |
| 2088 | |
| 2089 | |
| 2090 | void Context::addViewSource(const StoragePtr & storage) |
no test coverage detected