From b288278d9e4ae214f79c3f0b763d5d4071324d8e Mon Sep 17 00:00:00 2001 From: xxchan Date: Mon, 30 Sep 2024 17:07:27 +0800 Subject: [PATCH] refactor: remove prefix "rw_" in session variables Signed-off-by: xxchan --- .../batch/aggregate/two_phase_agg.slt.part | 8 +++--- e2e_test/batch/catalog/pg_settings.slt.part | 26 ++++++++--------- e2e_test/ddl/alter_session_params.slt | 26 +++++++++++++++++ .../source_inline/kafka/shared_source.slt | 4 +-- .../streaming/aggregate/two_phase_agg.slt | 8 +++--- risedev.yml | 2 +- src/common/proc_macro/src/session_config.rs | 7 +++-- src/common/src/session_config/mod.rs | 28 +++++++++---------- .../tests/testdata/input/agg.yaml | 6 ++-- .../tests/testdata/input/join_ordering.yaml | 6 ++-- .../tests/testdata/input/share.yaml | 6 ++-- .../tests/testdata/input/shared_source.yml | 20 ++++++------- .../tests/testdata/output/agg.yaml | 4 +-- .../tests/testdata/output/join_ordering.yaml | 4 +-- .../tests/testdata/output/share.yaml | 6 ++-- .../tests/testdata/output/shared_source.yml | 18 ++++++------ src/frontend/src/handler/create_source.rs | 2 +- src/frontend/src/lib.rs | 2 +- .../src/optimizer/plan_node/logical_source.rs | 2 +- src/risedevtool/src/config.rs | 2 +- src/tests/simulation/src/cluster.rs | 2 +- src/tests/sqlsmith/src/lib.rs | 4 +-- src/utils/runtime/src/logger.rs | 6 ++-- 23 files changed, 113 insertions(+), 86 deletions(-) diff --git a/e2e_test/batch/aggregate/two_phase_agg.slt.part b/e2e_test/batch/aggregate/two_phase_agg.slt.part index bb540e036b3fe..065b8dccea16d 100644 --- a/e2e_test/batch/aggregate/two_phase_agg.slt.part +++ b/e2e_test/batch/aggregate/two_phase_agg.slt.part @@ -2,14 +2,14 @@ statement ok SET RW_IMPLICIT_FLUSH TO true; statement ok -SET RW_ENABLE_TWO_PHASE_AGG=false; +SET ENABLE_TWO_PHASE_AGG=false; -# This should override `RW_ENABLE_TWO_PHASE_AGG`, enabling it. +# This should override `ENABLE_TWO_PHASE_AGG`, enabling it. statement ok SET RW_FORCE_TWO_PHASE_AGG=true; query T -SHOW RW_ENABLE_TWO_PHASE_AGG; +SHOW ENABLE_TWO_PHASE_AGG; ---- true @@ -41,4 +41,4 @@ aaaaaaaaaanz 0 0 abc 3 1 statement ok -drop table t; \ No newline at end of file +drop table t; diff --git a/e2e_test/batch/catalog/pg_settings.slt.part b/e2e_test/batch/catalog/pg_settings.slt.part index 641ce8ac65fde..278436a884c70 100644 --- a/e2e_test/batch/catalog/pg_settings.slt.part +++ b/e2e_test/batch/catalog/pg_settings.slt.part @@ -21,6 +21,8 @@ user application_name user backfill_rate_limit user background_ddl user batch_enable_distributed_dml +user batch_enable_lookup_join +user batch_enable_sort_agg user batch_parallelism user bypass_cluster_limits user bytea_output @@ -29,27 +31,21 @@ user client_encoding user client_min_messages user create_compaction_group_for_mv user datestyle +user enable_join_ordering +user enable_share_plan +user enable_shared_source +user enable_two_phase_agg user extra_float_digits +user force_split_distinct_agg +user force_two_phase_agg user idle_in_transaction_session_timeout +user implicit_flush user intervalstyle user lock_timeout user max_split_range_gap user query_epoch user query_mode user row_security -user rw_batch_enable_lookup_join -user rw_batch_enable_sort_agg -user rw_enable_join_ordering -user rw_enable_share_plan -user rw_enable_shared_source -user rw_enable_two_phase_agg -user rw_force_split_distinct_agg -user rw_force_two_phase_agg -user rw_implicit_flush -user rw_streaming_allow_jsonb_in_stream_key -user rw_streaming_enable_bushy_join -user rw_streaming_enable_delta_join -user rw_streaming_over_window_cache_policy user search_path user server_encoding user server_version @@ -58,7 +54,11 @@ user sink_decouple user source_rate_limit user standard_conforming_strings user statement_timeout +user streaming_allow_jsonb_in_stream_key +user streaming_enable_bushy_join +user streaming_enable_delta_join user streaming_max_parallelism +user streaming_over_window_cache_policy user streaming_parallelism user streaming_use_arrangement_backfill user streaming_use_snapshot_backfill diff --git a/e2e_test/ddl/alter_session_params.slt b/e2e_test/ddl/alter_session_params.slt index ba5cdff21ef12..ecaf7f09ebad3 100644 --- a/e2e_test/ddl/alter_session_params.slt +++ b/e2e_test/ddl/alter_session_params.slt @@ -1,3 +1,28 @@ +# Test aliases +# RW_ prefix are aliases to the one without prefix. +query T +show STREAMING_ENABLE_DELTA_JOIN; +---- +false + +statement ok +set STREAMING_ENABLE_DELTA_JOIN to true; + +query T +show STREAMING_ENABLE_DELTA_JOIN; +---- +true + +query T +show RW_STREAMING_ENABLE_DELTA_JOIN; +---- +true + +statement ok +set STREAMING_ENABLE_DELTA_JOIN to false; + +# Test aliases done + statement ok set RW_STREAMING_ENABLE_DELTA_JOIN to true; @@ -16,6 +41,7 @@ set RW_STREAMING_ENABLE_DELTA_JOIN to false; statement ok alter system set rw_streaming_enable_delta_join to true; +# Alter system won't change the current session's params. query T show RW_STREAMING_ENABLE_DELTA_JOIN; ---- diff --git a/e2e_test/source_inline/kafka/shared_source.slt b/e2e_test/source_inline/kafka/shared_source.slt index 5d1072df2cfaa..ca429781604e8 100644 --- a/e2e_test/source_inline/kafka/shared_source.slt +++ b/e2e_test/source_inline/kafka/shared_source.slt @@ -1,7 +1,7 @@ control substitution on statement ok -SET rw_enable_shared_source TO true; +SET enable_shared_source TO true; system ok rpk topic create shared_source -p 4 @@ -86,7 +86,7 @@ internal_table.mjs --name mv_1 --type sourcebackfill # This does not affect the behavior for CREATE MATERIALIZED VIEW below. It also uses the shared source, and creates SourceBackfillExecutor. statement ok -SET rw_enable_shared_source TO false; +SET enable_shared_source TO false; statement ok create materialized view mv_2 as select * from s0; diff --git a/e2e_test/streaming/aggregate/two_phase_agg.slt b/e2e_test/streaming/aggregate/two_phase_agg.slt index 652ae61b34f56..a60e400c33cf6 100644 --- a/e2e_test/streaming/aggregate/two_phase_agg.slt +++ b/e2e_test/streaming/aggregate/two_phase_agg.slt @@ -2,14 +2,14 @@ statement ok SET RW_IMPLICIT_FLUSH TO true; statement ok -SET RW_ENABLE_TWO_PHASE_AGG=false; +SET ENABLE_TWO_PHASE_AGG=false; -# This should override `RW_ENABLE_TWO_PHASE_AGG`, enabling it. +# This should override `ENABLE_TWO_PHASE_AGG`, enabling it. statement ok SET RW_FORCE_TWO_PHASE_AGG=true; query T -SHOW RW_ENABLE_TWO_PHASE_AGG; +SHOW ENABLE_TWO_PHASE_AGG; ---- true @@ -58,4 +58,4 @@ statement ok drop materialized view m1; statement ok -drop table t; \ No newline at end of file +drop table t; diff --git a/risedev.yml b/risedev.yml index da567f9180ae2..78b835dad973b 100644 --- a/risedev.yml +++ b/risedev.yml @@ -21,7 +21,7 @@ profile: # # Specify custom environment variables # env: # RUST_LOG: "info,risingwave_storage::hummock=off" - # RW_ENABLE_PRETTY_LOG: "true" + # ENABLE_PRETTY_LOG: "true" steps: # If you want to use the local s3 storage, enable the following line # - use: minio diff --git a/src/common/proc_macro/src/session_config.rs b/src/common/proc_macro/src/session_config.rs index c86993ebf5213..aff98faf11745 100644 --- a/src/common/proc_macro/src/session_config.rs +++ b/src/common/proc_macro/src/session_config.rs @@ -85,7 +85,7 @@ pub(crate) fn derive_config(input: DeriveInput) -> TokenStream { if let Some(alias) = alias { alias_to_entry_name_branches.push(quote! { - #alias => #entry_name, + #alias => #entry_name.to_string(), }) } @@ -277,10 +277,11 @@ pub(crate) fn derive_config(input: DeriveInput) -> TokenStream { } pub fn alias_to_entry_name(key_name: &str) -> String { - match key_name { + let key_name = key_name.to_ascii_lowercase(); + match key_name.as_str() { #(#alias_to_entry_name_branches)* _ => key_name, - }.to_ascii_lowercase() + } } #(#struct_impl_get)* diff --git a/src/common/src/session_config/mod.rs b/src/common/src/session_config/mod.rs index ec3f18a8e4205..43ac67363dd91 100644 --- a/src/common/src/session_config/mod.rs +++ b/src/common/src/session_config/mod.rs @@ -65,7 +65,7 @@ pub struct SessionConfig { /// If `RW_IMPLICIT_FLUSH` is on, then every INSERT/UPDATE/DELETE statement will block /// until the entire dataflow is refreshed. In other words, every related table & MV will /// be able to see the write. - #[parameter(default = false, rename = "rw_implicit_flush")] + #[parameter(default = false, alias = "rw_implicit_flush")] implicit_flush: bool, /// If `CREATE_COMPACTION_GROUP_FOR_MV` is on, dedicated compaction groups will be created in @@ -96,12 +96,12 @@ pub struct SessionConfig { date_style: String, /// Force the use of lookup join instead of hash join when possible for local batch execution. - #[parameter(default = true, rename = "rw_batch_enable_lookup_join")] + #[parameter(default = true, alias = "rw_batch_enable_lookup_join")] batch_enable_lookup_join: bool, /// Enable usage of sortAgg instead of hash agg when order property is satisfied in batch /// execution - #[parameter(default = true, rename = "rw_batch_enable_sort_agg")] + #[parameter(default = true, alias = "rw_batch_enable_sort_agg")] batch_enable_sort_agg: bool, /// Enable distributed DML, so an insert, delete, and update statement can be executed in a distributed way (e.g. running in multiple compute nodes). @@ -150,11 +150,11 @@ pub struct SessionConfig { streaming_parallelism: ConfigNonZeroU64, /// Enable delta join for streaming queries. Defaults to false. - #[parameter(default = false, rename = "rw_streaming_enable_delta_join")] + #[parameter(default = false, alias = "rw_streaming_enable_delta_join")] streaming_enable_delta_join: bool, /// Enable bushy join for streaming queries. Defaults to true. - #[parameter(default = true, rename = "rw_streaming_enable_bushy_join")] + #[parameter(default = true, alias = "rw_streaming_enable_bushy_join")] streaming_enable_bushy_join: bool, /// Enable arrangement backfill for streaming queries. Defaults to true. @@ -169,32 +169,32 @@ pub struct SessionConfig { streaming_use_snapshot_backfill: bool, /// Allow `jsonb` in stream key - #[parameter(default = false, rename = "rw_streaming_allow_jsonb_in_stream_key")] + #[parameter(default = false, alias = "rw_streaming_allow_jsonb_in_stream_key")] streaming_allow_jsonb_in_stream_key: bool, /// Enable join ordering for streaming and batch queries. Defaults to true. - #[parameter(default = true, rename = "rw_enable_join_ordering")] + #[parameter(default = true, alias = "rw_enable_join_ordering")] enable_join_ordering: bool, /// Enable two phase agg optimization. Defaults to true. /// Setting this to true will always set `FORCE_TWO_PHASE_AGG` to false. - #[parameter(default = true, flags = "SETTER", rename = "rw_enable_two_phase_agg")] + #[parameter(default = true, flags = "SETTER", alias = "rw_enable_two_phase_agg")] enable_two_phase_agg: bool, /// Force two phase agg optimization whenever there's a choice between /// optimizations. Defaults to false. /// Setting this to true will always set `ENABLE_TWO_PHASE_AGG` to false. - #[parameter(default = false, flags = "SETTER", rename = "rw_force_two_phase_agg")] + #[parameter(default = false, flags = "SETTER", alias = "rw_force_two_phase_agg")] force_two_phase_agg: bool, /// Enable sharing of common sub-plans. /// This means that DAG structured query plans can be constructed, - #[parameter(default = true, rename = "rw_enable_share_plan")] + #[parameter(default = true, alias = "rw_enable_share_plan")] /// rather than only tree structured query plans. enable_share_plan: bool, /// Enable split distinct agg - #[parameter(default = false, rename = "rw_force_split_distinct_agg")] + #[parameter(default = false, alias = "rw_force_split_distinct_agg")] force_split_distinct_agg: bool, /// See @@ -276,7 +276,7 @@ pub struct SessionConfig { /// Cache policy for partition cache in streaming over window. /// Can be "full", "recent", "`recent_first_n`" or "`recent_last_n`". #[serde_as(as = "DisplayFromStr")] - #[parameter(default = OverWindowCachePolicy::default(), rename = "rw_streaming_over_window_cache_policy")] + #[parameter(default = OverWindowCachePolicy::default(), alias = "rw_streaming_over_window_cache_policy")] streaming_over_window_cache_policy: OverWindowCachePolicy, /// Run DDL statements in background @@ -287,8 +287,8 @@ pub struct SessionConfig { /// /// When enabled, `CREATE SOURCE` will create a source streaming job, and `CREATE MATERIALIZED VIEWS` from the source /// will forward the data from the same source streaming job, and also backfill prior data from the external source. - #[parameter(default = false)] - rw_enable_shared_source: bool, + #[parameter(default = false, alias = "rw_enable_shared_source")] + enable_shared_source: bool, /// Shows the server-side character set encoding. At present, this parameter can be shown but not set, because the encoding is determined at database creation time. #[parameter(default = SERVER_ENCODING)] diff --git a/src/frontend/planner_test/tests/testdata/input/agg.yaml b/src/frontend/planner_test/tests/testdata/input/agg.yaml index daf6df4049416..be08720447966 100644 --- a/src/frontend/planner_test/tests/testdata/input/agg.yaml +++ b/src/frontend/planner_test/tests/testdata/input/agg.yaml @@ -758,7 +758,7 @@ - name: enable two phase aggregation with simple agg should have two phase agg sql: | SET QUERY_MODE TO DISTRIBUTED; - SET RW_ENABLE_TWO_PHASE_AGG=true; + SET ENABLE_TWO_PHASE_AGG=true; create table t(v1 int, v2 int); select min(v1), sum(v2) from t; expected_outputs: @@ -767,7 +767,7 @@ - name: disable two phase aggregation with simple agg sql: | SET QUERY_MODE TO DISTRIBUTED; - SET RW_ENABLE_TWO_PHASE_AGG=false; + SET ENABLE_TWO_PHASE_AGG=false; create table t(v1 int, v2 int); select min(v1), sum(v2) from t; expected_outputs: @@ -1118,4 +1118,4 @@ CREATE TABLE t (v1 int, v2 int); SELECT approx_percentile(0.0, 1.0) WITHIN GROUP (order by v1) from t group by v2; expected_outputs: - - binder_error \ No newline at end of file + - binder_error diff --git a/src/frontend/planner_test/tests/testdata/input/join_ordering.yaml b/src/frontend/planner_test/tests/testdata/input/join_ordering.yaml index d08acd15a12d8..92f2b2ba89018 100644 --- a/src/frontend/planner_test/tests/testdata/input/join_ordering.yaml +++ b/src/frontend/planner_test/tests/testdata/input/join_ordering.yaml @@ -23,7 +23,7 @@ - batch_plan - name: bushy tree join ordering manually sql: | - set rw_enable_join_ordering = false; + set enable_join_ordering = false; create table t1 (v1 int, v2 int); create table t2 (v3 int, v4 int); create table t3 (v5 int, v6 int); @@ -35,7 +35,7 @@ - batch_plan - name: right deep tree join ordering manually sql: | - set rw_enable_join_ordering = false; + set enable_join_ordering = false; create table t1 (v1 int, v2 int); create table t2 (v3 int, v4 int); create table t3 (v5 int, v6 int); @@ -44,4 +44,4 @@ expected_outputs: - logical_plan - stream_plan - - batch_plan \ No newline at end of file + - batch_plan diff --git a/src/frontend/planner_test/tests/testdata/input/share.yaml b/src/frontend/planner_test/tests/testdata/input/share.yaml index 91217f52d3851..51863d21b45b8 100644 --- a/src/frontend/planner_test/tests/testdata/input/share.yaml +++ b/src/frontend/planner_test/tests/testdata/input/share.yaml @@ -61,13 +61,13 @@ - logical_plan - batch_plan - sql: | - set rw_enable_share_plan=true; + set enable_share_plan=true; create table t(a int, b int); with cte as (select count(*) from t) select * from cte union all select * from cte; expected_outputs: - stream_plan - sql: | - set rw_enable_share_plan=false; + set enable_share_plan=false; create table t(a int, b int); with cte as (select count(*) from t) select * from cte union all select * from cte; expected_outputs: @@ -76,7 +76,7 @@ before: - create_sources sql: | - set rw_enable_share_plan=false; + set enable_share_plan=false; select count(*) cnt from auction A join auction B on A.id = B.id; expected_outputs: - stream_plan diff --git a/src/frontend/planner_test/tests/testdata/input/shared_source.yml b/src/frontend/planner_test/tests/testdata/input/shared_source.yml index 952ae8dcc5aa0..71c87ab2e3ce1 100644 --- a/src/frontend/planner_test/tests/testdata/input/shared_source.yml +++ b/src/frontend/planner_test/tests/testdata/input/shared_source.yml @@ -9,7 +9,7 @@ ) FORMAT PLAIN ENCODE JSON; expected_outputs: [] - with_config_map: - rw_enable_shared_source: true + enable_shared_source: true sql: | /* The shared source config doesn't affect table with connector. */ EXPLAIN CREATE TABLE s(x int,y int) @@ -25,43 +25,43 @@ # We use with_config_map to control the config when CREATE SOURCE, and use another SET statement to change the config for CREATE MV # # batch: All 4 plans should be the same. -# stream: StreamSourceScan (with backfill) should be used only for the last 2. The first 2 use StreamSource. rw_enable_shared_source changes the behavior of CREATE SOURCE, but not CREATE MATERIALIZED VIEW +# stream: StreamSourceScan (with backfill) should be used only for the last 2. The first 2 use StreamSource. enable_shared_source changes the behavior of CREATE SOURCE, but not CREATE MATERIALIZED VIEW - with_config_map: - rw_enable_shared_source: false + enable_shared_source: false before: - create_source sql: | - SET rw_enable_shared_source = false; + SET enable_shared_source = false; select * from s; expected_outputs: - batch_plan - stream_plan - with_config_map: - rw_enable_shared_source: false + enable_shared_source: false before: - create_source sql: | - SET rw_enable_shared_source = true; + SET enable_shared_source = true; select * from s; expected_outputs: - batch_plan - stream_plan - with_config_map: - rw_enable_shared_source: true + enable_shared_source: true before: - create_source sql: | - SET rw_enable_shared_source = false; + SET enable_shared_source = false; select * from s; expected_outputs: - batch_plan - stream_plan - with_config_map: - rw_enable_shared_source: true + enable_shared_source: true before: - create_source sql: | - SET rw_enable_shared_source = true; + SET enable_shared_source = true; select * from s; expected_outputs: - batch_plan diff --git a/src/frontend/planner_test/tests/testdata/output/agg.yaml b/src/frontend/planner_test/tests/testdata/output/agg.yaml index 424b58996fcbc..197bca883ca77 100644 --- a/src/frontend/planner_test/tests/testdata/output/agg.yaml +++ b/src/frontend/planner_test/tests/testdata/output/agg.yaml @@ -1360,7 +1360,7 @@ - name: enable two phase aggregation with simple agg should have two phase agg sql: | SET QUERY_MODE TO DISTRIBUTED; - SET RW_ENABLE_TWO_PHASE_AGG=true; + SET ENABLE_TWO_PHASE_AGG=true; create table t(v1 int, v2 int); select min(v1), sum(v2) from t; batch_plan: |- @@ -1379,7 +1379,7 @@ - name: disable two phase aggregation with simple agg sql: | SET QUERY_MODE TO DISTRIBUTED; - SET RW_ENABLE_TWO_PHASE_AGG=false; + SET ENABLE_TWO_PHASE_AGG=false; create table t(v1 int, v2 int); select min(v1), sum(v2) from t; batch_plan: |- diff --git a/src/frontend/planner_test/tests/testdata/output/join_ordering.yaml b/src/frontend/planner_test/tests/testdata/output/join_ordering.yaml index b47f962b23503..e1d18b0bd470c 100644 --- a/src/frontend/planner_test/tests/testdata/output/join_ordering.yaml +++ b/src/frontend/planner_test/tests/testdata/output/join_ordering.yaml @@ -98,7 +98,7 @@ └─StreamTableScan { table: t3, columns: [t3.v5, t3.v6, t3._row_id], stream_scan_type: ArrangementBackfill, stream_key: [t3._row_id], pk: [_row_id], dist: UpstreamHashShard(t3._row_id) } - name: bushy tree join ordering manually sql: | - set rw_enable_join_ordering = false; + set enable_join_ordering = false; create table t1 (v1 int, v2 int); create table t2 (v3 int, v4 int); create table t3 (v5 int, v6 int); @@ -146,7 +146,7 @@ └─StreamTableScan { table: t4, columns: [t4.v7, t4.v8, t4._row_id], stream_scan_type: ArrangementBackfill, stream_key: [t4._row_id], pk: [_row_id], dist: UpstreamHashShard(t4._row_id) } - name: right deep tree join ordering manually sql: | - set rw_enable_join_ordering = false; + set enable_join_ordering = false; create table t1 (v1 int, v2 int); create table t2 (v3 int, v4 int); create table t3 (v5 int, v6 int); diff --git a/src/frontend/planner_test/tests/testdata/output/share.yaml b/src/frontend/planner_test/tests/testdata/output/share.yaml index b9a7fe05b6681..abdb5f29a55a8 100644 --- a/src/frontend/planner_test/tests/testdata/output/share.yaml +++ b/src/frontend/planner_test/tests/testdata/output/share.yaml @@ -147,7 +147,7 @@ └─StreamRowIdGen { row_id_index: 7 } └─StreamSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } - sql: | - set rw_enable_share_plan=true; + set enable_share_plan=true; create table t(a int, b int); with cte as (select count(*) from t) select * from cte union all select * from cte; stream_plan: |- @@ -170,7 +170,7 @@ └─StreamStatelessSimpleAgg { aggs: [count] } └─StreamTableScan { table: t, columns: [t._row_id], stream_scan_type: ArrangementBackfill, stream_key: [t._row_id], pk: [_row_id], dist: UpstreamHashShard(t._row_id) } - sql: | - set rw_enable_share_plan=false; + set enable_share_plan=false; create table t(a int, b int); with cte as (select count(*) from t) select * from cte union all select * from cte; stream_plan: |- @@ -192,7 +192,7 @@ before: - create_sources sql: | - set rw_enable_share_plan=false; + set enable_share_plan=false; select count(*) cnt from auction A join auction B on A.id = B.id; stream_plan: |- StreamMaterialize { columns: [cnt], stream_key: [], pk_columns: [], pk_conflict: NoCheck } diff --git a/src/frontend/planner_test/tests/testdata/output/shared_source.yml b/src/frontend/planner_test/tests/testdata/output/shared_source.yml index 39fb6b799fb83..5083c23952f3b 100644 --- a/src/frontend/planner_test/tests/testdata/output/shared_source.yml +++ b/src/frontend/planner_test/tests/testdata/output/shared_source.yml @@ -27,11 +27,11 @@ └─StreamDml { columns: [x, y, _row_id] } └─StreamSource with_config_map: - rw_enable_shared_source: 'true' + enable_shared_source: 'true' - before: - create_source sql: | - SET rw_enable_shared_source = false; + SET enable_shared_source = false; select * from s; batch_plan: |- BatchExchange { order: [], dist: Single } @@ -43,11 +43,11 @@ └─StreamRowIdGen { row_id_index: 3 } └─StreamSource { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id] } with_config_map: - rw_enable_shared_source: 'false' + enable_shared_source: 'false' - before: - create_source sql: | - SET rw_enable_shared_source = true; + SET enable_shared_source = true; select * from s; batch_plan: |- BatchExchange { order: [], dist: Single } @@ -59,11 +59,11 @@ └─StreamRowIdGen { row_id_index: 3 } └─StreamSource { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id] } with_config_map: - rw_enable_shared_source: 'false' + enable_shared_source: 'false' - before: - create_source sql: | - SET rw_enable_shared_source = false; + SET enable_shared_source = false; select * from s; batch_plan: |- BatchExchange { order: [], dist: Single } @@ -75,11 +75,11 @@ └─StreamRowIdGen { row_id_index: 3 } └─StreamSourceScan { columns: [x, y, _rw_kafka_timestamp, _row_id, _rw_kafka_partition, _rw_kafka_offset] } with_config_map: - rw_enable_shared_source: 'true' + enable_shared_source: 'true' - before: - create_source sql: | - SET rw_enable_shared_source = true; + SET enable_shared_source = true; select * from s; batch_plan: |- BatchExchange { order: [], dist: Single } @@ -91,4 +91,4 @@ └─StreamRowIdGen { row_id_index: 3 } └─StreamSourceScan { columns: [x, y, _rw_kafka_timestamp, _row_id, _rw_kafka_partition, _rw_kafka_offset] } with_config_map: - rw_enable_shared_source: 'true' + enable_shared_source: 'true' diff --git a/src/frontend/src/handler/create_source.rs b/src/frontend/src/handler/create_source.rs index aeaa026dffffe..d6338b89456aa 100644 --- a/src/frontend/src/handler/create_source.rs +++ b/src/frontend/src/handler/create_source.rs @@ -1662,7 +1662,7 @@ pub async fn handle_create_source( let create_cdc_source_job = with_properties.is_shareable_cdc_connector(); let is_shared = create_cdc_source_job || (with_properties.is_shareable_non_cdc_connector() - && session.config().rw_enable_shared_source()); + && session.config().enable_shared_source()); let (columns_from_resolve_source, mut source_info) = if create_cdc_source_job { bind_columns_from_source_for_cdc(&session, &source_schema)? diff --git a/src/frontend/src/lib.rs b/src/frontend/src/lib.rs index d3d5d1623bd58..8dbd09a19a629 100644 --- a/src/frontend/src/lib.rs +++ b/src/frontend/src/lib.rs @@ -148,7 +148,7 @@ pub struct FrontendOpts { #[override_opts(path = server.metrics_level)] pub metrics_level: Option, - #[clap(long, hide = true, env = "RW_ENABLE_BARRIER_READ")] + #[clap(long, hide = true, env = "ENABLE_BARRIER_READ")] #[override_opts(path = batch.enable_barrier_read)] pub enable_barrier_read: Option, diff --git a/src/frontend/src/optimizer/plan_node/logical_source.rs b/src/frontend/src/optimizer/plan_node/logical_source.rs index 50024b4274e77..5bbf1a0216411 100644 --- a/src/frontend/src/optimizer/plan_node/logical_source.rs +++ b/src/frontend/src/optimizer/plan_node/logical_source.rs @@ -354,7 +354,7 @@ impl ToStream for LogicalSource { } SourceNodeKind::CreateMViewOrBatch => { // Create MV on source. - // We only check rw_enable_shared_source is true when `CREATE SOURCE`. + // We only check enable_shared_source is true when `CREATE SOURCE`. // The value does not affect the behavior of `CREATE MATERIALIZED VIEW` here. let use_shared_source = self.source_catalog().is_some_and(|c| c.info.is_shared()); if use_shared_source { diff --git a/src/risedevtool/src/config.rs b/src/risedevtool/src/config.rs index 1abab635b88c1..5f0a489270a88 100644 --- a/src/risedevtool/src/config.rs +++ b/src/risedevtool/src/config.rs @@ -57,7 +57,7 @@ impl ConfigExpander { /// config-path: src/config/ci-recovery.toml /// env: /// RUST_LOG: "info,risingwave_storage::hummock=off" - /// RW_ENABLE_PRETTY_LOG: "true" + /// ENABLE_PRETTY_LOG: "true" /// steps: /// - use: minio /// - use: sqlite diff --git a/src/tests/simulation/src/cluster.rs b/src/tests/simulation/src/cluster.rs index a9ffba0063562..52a593de507ec 100644 --- a/src/tests/simulation/src/cluster.rs +++ b/src/tests/simulation/src/cluster.rs @@ -166,7 +166,7 @@ impl Configuration { pub fn for_scale_shared_source() -> Self { let mut conf = Self::for_scale(); - conf.per_session_queries = vec!["SET RW_ENABLE_SHARED_SOURCE = true;".into()].into(); + conf.per_session_queries = vec!["SET ENABLE_SHARED_SOURCE = true;".into()].into(); conf } diff --git a/src/tests/sqlsmith/src/lib.rs b/src/tests/sqlsmith/src/lib.rs index 2eb9c59d1bf38..1c31041a7e484 100644 --- a/src/tests/sqlsmith/src/lib.rs +++ b/src/tests/sqlsmith/src/lib.rs @@ -89,8 +89,8 @@ pub fn differential_sql_gen( /// generated query when `QUERY_MODE=local`. pub fn session_sql_gen(rng: &mut R) -> String { [ - "SET RW_ENABLE_TWO_PHASE_AGG TO TRUE", - "SET RW_ENABLE_TWO_PHASE_AGG TO FALSE", + "SET ENABLE_TWO_PHASE_AGG TO TRUE", + "SET ENABLE_TWO_PHASE_AGG TO FALSE", "SET RW_FORCE_TWO_PHASE_AGG TO TRUE", "SET RW_FORCE_TWO_PHASE_AGG TO FALSE", ] diff --git a/src/utils/runtime/src/logger.rs b/src/utils/runtime/src/logger.rs index bf033ba23f330..f2dfaef21b22e 100644 --- a/src/utils/runtime/src/logger.rs +++ b/src/utils/runtime/src/logger.rs @@ -178,7 +178,7 @@ fn disabled_filter() -> filter::Targets { /// `RW_QUERY_LOG_TRUNCATE_LEN` configures the max length of the SQLs logged in the query log, /// to avoid the log file growing too large. The default value is 1024 in production. /// -/// ### `RW_ENABLE_PRETTY_LOG` +/// ### `ENABLE_PRETTY_LOG` /// /// If it is set to `true`, enable pretty log output, which contains line numbers and prints spans in multiple lines. /// This can be helpful for development and debugging. @@ -186,7 +186,7 @@ fn disabled_filter() -> filter::Targets { /// Hint: Also turn off other uninteresting logs to make the most of the pretty log. /// e.g., /// ```bash -/// RUST_LOG="risingwave_storage::hummock::event_handler=off,batch_execute=off,risingwave_batch::task=off" RW_ENABLE_PRETTY_LOG=true risedev d +/// RUST_LOG="risingwave_storage::hummock::event_handler=off,batch_execute=off,risingwave_batch::task=off" ENABLE_PRETTY_LOG=true risedev d /// ``` pub fn init_risingwave_logger(settings: LoggerSettings) { let deployment = Deployment::current(); @@ -296,7 +296,7 @@ pub fn init_risingwave_logger(settings: LoggerSettings) { .map_event_format(|e| e.with_current_span(false)) // avoid duplication as there's a span list field .boxed(), Deployment::Other => { - if env_var_is_true("RW_ENABLE_PRETTY_LOG") { + if env_var_is_true("ENABLE_PRETTY_LOG") { fmt_layer.pretty().boxed() } else { fmt_layer.boxed()