Skip to content

Commit

Permalink
Merge branch 'main' into feat/server-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
oh2024 authored Apr 18, 2024
2 parents 5f79ed9 + 6b52ee5 commit 18c0e2e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion demo/quick_start/cluster_quickstart.sql
Original file line number Diff line number Diff line change
@@ -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;
SHOW DEPLOYMENT demo_data_service;
2 changes: 1 addition & 1 deletion docs/en/openmldb_sql/ddl/SET_STATEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br />In offline execution mode, only offline data will be imported/inserted and queried.<br />In online execution mode, only online data will be imported/inserted and queried. | `offline`, <br /> `online"` | `offline` |
| @@session.execute_mode|@@execute_mode | The execution mode of OpenMDLB in the current session. Currently supports `offline` and `online` two modes.<br />In offline execution mode, only offline data will be imported/inserted and queried.<br />In online execution mode, only online data will be imported/inserted and queried. | `offline`, <br /> `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. <br />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`, <br /> `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.<br />When the value is `false`, the offline command returns immediately. If you need to check the execution, please use `SHOW JOB` command. | `true`, <br /> `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 |
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/openmldb_sql/ddl/SET_STATEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sessionVariableName ::= '@@'Identifier | '@@session.'Identifier | '@@global.'Ide

| SESSION系统变量 | 变量描述 | 变量值 | 默认值 |
| -------------------------------------- |---------------------------------------------------------------------------------------------------------------| --------------------- | --------- |
| @@session.execute_mode|@@execute_mode | OpenMDLB在当前会话下的执行模式。目前支持`offline``online`两种模式。<br />在离线执行模式下,只会导入/插入以及查询离线数据。<br />在在线执行模式下,只会导入/插入以及查询在线数据。 | "offline" \| "online" | "offline" |
| @@session.execute_mode|@@execute_mode | OpenMDLB在当前会话下的执行模式。目前支持`offline``online`两种模式。<br />在离线执行模式下,只会导入/插入以及查询离线数据。<br />在在线执行模式下,只会导入/插入以及查询在线数据。 | "offline" \| "online" | "online" |
| @@session.enable_trace|@@enable_trace | 当该变量值为 `true`,SQL语句有语法错误或者在计划生成过程发生错误时,会打印错误信息栈。<br />当该变量值为 `false`,SQL语句有语法错误或者在计划生成过程发生错误时,仅打印基本错误信息。 | "true" \| "false" | "false" |
| @@session.sync_job|@@sync_job | 当该变量值为 `true`,离线的命令将变为同步,等待执行的最终结果。<br />当该变量值为 `false`,离线的命令即时返回,若要查看命令的执行情况,请使用`SHOW JOB`| "true" \| "false" | "false" |
| @@session.job_timeout|@@job_timeout | 可配置离线异步命令或离线管理命令的等待时间(以*毫秒*为单位),将立即返回。离线异步命令返回后仍可通过`SHOW JOB`查看命令执行情况。 | Int | "20000" |
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/sql_cmd_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3954,7 +3954,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);
Expand Down
6 changes: 5 additions & 1 deletion src/nameserver/name_server_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10003,7 +10003,11 @@ void NameServerImpl::ShowFunction(RpcController* controller, const ShowFunctionR

base::Status NameServerImpl::InitGlobalVarTable() {
std::map<std::string, std::string> default_value = {
{"execute_mode", "offline"}, {"enable_trace", "false"}, {"sync_job", "false"}, {"job_timeout", "20000"}};
{"execute_mode", "online"},
{"enable_trace", "false"},
{"sync_job", "false"},
{"job_timeout", "20000"}
};
// get table_info
std::string db = INFORMATION_SCHEMA_DB;
std::string table = GLOBAL_VARIABLES;
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/sql_cluster_router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/tablet/tablet_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::map<std::string, std::string>>();
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]);
Expand Down

0 comments on commit 18c0e2e

Please sign in to comment.