diff --git a/demo/quick_start/cluster_quickstart.sql b/demo/quick_start/cluster_quickstart.sql index 2e7df0ab4cf..0e788375f6e 100644 --- a/demo/quick_start/cluster_quickstart.sql +++ b/demo/quick_start/cluster_quickstart.sql @@ -1,10 +1,11 @@ CREATE DATABASE demo_db; USE demo_db; CREATE TABLE demo_table1(c1 string, c2 int, c3 bigint, c4 float, c5 double, c6 timestamp, c7 date); +SET @@execute_mode='offline'; SET @@sync_job=true; LOAD DATA INFILE 'file:///work/taxi-trip/data/data.parquet' INTO TABLE demo_table1 options(format='parquet', mode='append'); SELECT c1, c2, sum(c3) OVER w1 AS w1_c3_sum FROM demo_table1 WINDOW w1 AS (PARTITION BY demo_table1.c1 ORDER BY demo_table1.c6 ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) INTO OUTFILE '/tmp/feature_data' OPTIONS(mode='overwrite'); SET @@execute_mode='online'; DEPLOY demo_data_service SELECT c1, c2, sum(c3) OVER w1 AS w1_c3_sum FROM demo_table1 WINDOW w1 AS (PARTITION BY demo_table1.c1 ORDER BY demo_table1.c6 ROWS BETWEEN 2 PRECEDING AND CURRENT ROW); LOAD DATA INFILE 'file:///work/taxi-trip/data/data.parquet' INTO TABLE demo_table1 options(format='parquet', mode='append'); -SHOW DEPLOYMENT demo_data_service; \ No newline at end of file +SHOW DEPLOYMENT demo_data_service; diff --git a/docs/en/openmldb_sql/ddl/SET_STATEMENT.md b/docs/en/openmldb_sql/ddl/SET_STATEMENT.md index 25d03370eaf..d64f06bf20a 100644 --- a/docs/en/openmldb_sql/ddl/SET_STATEMENT.md +++ b/docs/en/openmldb_sql/ddl/SET_STATEMENT.md @@ -30,7 +30,7 @@ The following format is also equivalent. | SESSION System Variable | Note | Variable Value | Default Value | | -------------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------| ----- | -| @@session.execute_mode|@@execute_mode | The execution mode of OpenMDLB in the current session. Currently supports `offline` and `online` two modes.
In offline execution mode, only offline data will be imported/inserted and queried.
In online execution mode, only online data will be imported/inserted and queried. | `offline`,
`online"` | `offline` | +| @@session.execute_mode|@@execute_mode | The execution mode of OpenMDLB in the current session. Currently supports `offline` and `online` two modes.
In offline execution mode, only offline data will be imported/inserted and queried.
In online execution mode, only online data will be imported/inserted and queried. | `offline`,
`online"` | `online` | | @@session.enable_trace|@@enable_trace | When the value is `true`, an error message stack will be printed when the SQL statement has a syntax error or an error occurs during the plan generation process.
When the value is `false`, only the basic error message will be printed if there is a SQL syntax error or an error occurs during the plan generation process. | `true`,
`false` | `false` | | @@session.sync_job|@@sync_job | When the value is `true`, the offline command will be executed synchronously, waiting for the final result of the execution.
When the value is `false`, the offline command returns immediately. If you need to check the execution, please use `SHOW JOB` command. | `true`,
`false` | `false` | | @@session.sync_timeout|@@sync_timeout | When `sync_job=true`, you can configure the waiting time for synchronization commands. The timeout will return immediately. After the timeout returns, you can still view the command execution through `SHOW JOB`. | Int | 20000 | diff --git a/docs/zh/openmldb_sql/ddl/SET_STATEMENT.md b/docs/zh/openmldb_sql/ddl/SET_STATEMENT.md index 4b63861e59f..839765dface 100644 --- a/docs/zh/openmldb_sql/ddl/SET_STATEMENT.md +++ b/docs/zh/openmldb_sql/ddl/SET_STATEMENT.md @@ -31,7 +31,7 @@ sessionVariableName ::= '@@'Identifier | '@@session.'Identifier | '@@global.'Ide | SESSION系统变量 | 变量描述 | 变量值 | 默认值 | | -------------------------------------- |---------------------------------------------------------------------------------------------------------------| --------------------- | --------- | -| @@session.execute_mode|@@execute_mode | OpenMDLB在当前会话下的执行模式。目前支持`offline`和`online`两种模式。
在离线执行模式下,只会导入/插入以及查询离线数据。
在在线执行模式下,只会导入/插入以及查询在线数据。 | "offline" \| "online" | "offline" | +| @@session.execute_mode|@@execute_mode | OpenMDLB在当前会话下的执行模式。目前支持`offline`和`online`两种模式。
在离线执行模式下,只会导入/插入以及查询离线数据。
在在线执行模式下,只会导入/插入以及查询在线数据。 | "offline" \| "online" | "online" | | @@session.enable_trace|@@enable_trace | 当该变量值为 `true`,SQL语句有语法错误或者在计划生成过程发生错误时,会打印错误信息栈。
当该变量值为 `false`,SQL语句有语法错误或者在计划生成过程发生错误时,仅打印基本错误信息。 | "true" \| "false" | "false" | | @@session.sync_job|@@sync_job | 当该变量值为 `true`,离线的命令将变为同步,等待执行的最终结果。
当该变量值为 `false`,离线的命令即时返回,若要查看命令的执行情况,请使用`SHOW JOB`。 | "true" \| "false" | "false" | | @@session.job_timeout|@@job_timeout | 可配置离线异步命令或离线管理命令的等待时间(以*毫秒*为单位),将立即返回。离线异步命令返回后仍可通过`SHOW JOB`查看命令执行情况。 | Int | "20000" | diff --git a/src/cmd/sql_cmd_test.cc b/src/cmd/sql_cmd_test.cc index 3364c2cb0cf..fe8faa21504 100644 --- a/src/cmd/sql_cmd_test.cc +++ b/src/cmd/sql_cmd_test.cc @@ -3951,7 +3951,7 @@ TEST_P(DBSDKTest, GlobalVariable) { {"enable_trace", "false"}, {"sync_job", "false"}, {"job_timeout", "20000"}, - {"execute_mode", "offline"}}, + {"execute_mode", "online"}}, rs.get()); // init session variables from systemtable rs = sr->ExecuteSQL("show session variables", &status); diff --git a/src/nameserver/name_server_impl.cc b/src/nameserver/name_server_impl.cc index eaf1f8ca7a9..540e4b13ff8 100644 --- a/src/nameserver/name_server_impl.cc +++ b/src/nameserver/name_server_impl.cc @@ -9938,7 +9938,7 @@ void NameServerImpl::ShowFunction(RpcController* controller, const ShowFunctionR base::Status NameServerImpl::InitGlobalVarTable() { std::map default_value = { - {"execute_mode", "offline"}, + {"execute_mode", "online"}, {"enable_trace", "false"}, {"sync_job", "false"}, {"job_timeout", "20000"} diff --git a/src/sdk/sql_cluster_router.cc b/src/sdk/sql_cluster_router.cc index 924a3169c28..7076804ff49 100644 --- a/src/sdk/sql_cluster_router.cc +++ b/src/sdk/sql_cluster_router.cc @@ -191,7 +191,7 @@ bool SQLClusterRouter::Init() { } } else { // if not allowed to get system table or system table is empty, init session here - session_variables_.emplace("execute_mode", "offline"); + session_variables_.emplace("execute_mode", "online"); session_variables_.emplace("enable_trace", "false"); session_variables_.emplace("sync_job", "false"); session_variables_.emplace("job_timeout", "60000"); // rpc request timeout for taskmanager diff --git a/src/tablet/tablet_impl.cc b/src/tablet/tablet_impl.cc index 6ffd86918ca..2537e882008 100644 --- a/src/tablet/tablet_impl.cc +++ b/src/tablet/tablet_impl.cc @@ -179,7 +179,7 @@ bool TabletImpl::Init(const std::string& zk_cluster, const std::string& zk_path, sp_root_path_ = zk_path + "/store_procedure/db_sp_data"; globalvar_changed_notify_path_ = zk_path + "/notify/global_variable"; global_variables_ = std::make_shared>(); - global_variables_->emplace("execute_mode", "offline"); + global_variables_->emplace("execute_mode", "online"); global_variables_->emplace("enable_trace", "false"); ::openmldb::base::SplitString(FLAGS_db_root_path, ",", mode_root_paths_[::openmldb::common::kMemory]);