Fix mview auto complete refresh parallel

This commit is contained in:
obdev
2024-02-08 10:08:01 +00:00
committed by ob-robot
parent b915bb10a0
commit f5bb32e3bf
14 changed files with 69 additions and 42 deletions

View File

@ -7870,7 +7870,7 @@ create_with_opt_hint opt_replace opt_algorithm opt_definer opt_sql_security VIEW
UNUSED($3);
UNUSED($4);
UNUSED($5);
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_VIEW, 11,
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_VIEW, 12,
NULL, /* opt_materialized, not support*/
$7, /* view name */
$8, /* column list */
@ -7879,7 +7879,7 @@ create_with_opt_hint opt_replace opt_algorithm opt_definer opt_sql_security VIEW
$2,
$12, /* with option */
NULL, /* force view opt */
NULL, NULL, NULL
NULL, NULL, NULL, NULL
);
dup_expr_string($11, result, @11.first_column, @11.last_column);
$$->reserved_ = 0; /* is create view */
@ -7914,11 +7914,10 @@ create_with_opt_hint opt_replace opt_algorithm opt_definer opt_sql_security VIEW
create_mview_stmt:
create_with_opt_hint MATERIALIZED VIEW view_name opt_column_list opt_table_option_list opt_partition_option create_mview_refresh AS view_select_stmt opt_check_option
{
(void)($1);
ParseNode *table_options = NULL;
merge_nodes(table_options, result, T_TABLE_OPTION_LIST, $6);
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_VIEW, 11,
malloc_non_terminal_node($$, result->malloc_pool_, T_CREATE_VIEW, 12,
NULL, /* opt_materialized, not support*/
$4, /* view name */
$5, /* column list */
@ -7929,7 +7928,8 @@ create_with_opt_hint MATERIALIZED VIEW view_name opt_column_list opt_table_optio
NULL, /* force view opt */
$8,
$7, /* partition option */
table_options /* table options */
table_options, /* table options */
$1 /* hint */
);
dup_expr_string($10, result, @10.first_column, @10.last_column);
$$->reserved_ = 2; /* create materialized view */

View File

@ -340,6 +340,13 @@ int ObCreateViewResolver::resolve(const ParseNode &parse_tree)
container_table_schema.set_mv_container_table(IS_MV_CONTAINER_TABLE);
}
}
if (OB_SUCC(ret)) {
if (OB_FAIL(resolve_hints(parse_tree.children_[HINT_NODE], *stmt, container_table_schema))) {
LOG_WARN("resolve hints failed", K(ret));
} else {
mv_ainfo.mv_refresh_info_.parallel_ = stmt->get_parallelism();
}
}
if (OB_SUCC(ret)) {
ObViewSchema &view_schema = table_schema.get_view_schema();
if (OB_FAIL(resolve_mv_refresh_info(parse_tree.children_[MVIEW_NODE], mv_ainfo.mv_refresh_info_))) {

View File

@ -44,7 +44,8 @@ class ObCreateViewResolver : public ObCreateTableResolverBase
static const int64_t MVIEW_NODE = 8;
static const int64_t PARTITION_NODE = 9;
static const int64_t TABLE_OPTION_NODE = 10;
static const int64_t ROOT_NUM_CHILD = 11;
static const int64_t HINT_NODE = 11;
static const int64_t ROOT_NUM_CHILD = 12;
public:
explicit ObCreateViewResolver(ObResolverParams &params);