#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace ProfileEvents { extern const Event Query; extern const Event SelectQuery; extern const Event InsertQuery; } namespace DB { namespace ErrorCodes { extern const int UNKNOWN_TYPE_OF_QUERY; } std::unique_ptr InterpreterFactory::get(ASTPtr & query, ContextMutablePtr context, const SelectQueryOptions & options) { OpenTelemetrySpanHolder span("InterpreterFactory::get()"); ProfileEvents::increment(ProfileEvents::Query); if (query->as()) { /// This is internal part of ASTSelectWithUnionQuery. /// Even if there is SELECT without union, it is represented by ASTSelectWithUnionQuery with single ASTSelectQuery as a child. return std::make_unique(query, context, options); } else if (query->as()) { ProfileEvents::increment(ProfileEvents::SelectQuery); return std::make_unique(query, context, options); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { ProfileEvents::increment(ProfileEvents::InsertQuery); bool allow_materialized = static_cast(context->getSettingsRef().insert_allow_materialized_columns); return std::make_unique(query, context, allow_materialized); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { /// readonly is checked inside InterpreterSetQuery return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else if (query->as()) { return std::make_unique(query, context); } else { throw Exception("Unknown type of query: " + query->getID(), ErrorCodes::UNKNOWN_TYPE_OF_QUERY); } } }