Skip to content

Commit

Permalink
fix(4paradigm#3909): checkout execute_mode in config clause in sql cl…
Browse files Browse the repository at this point in the history
…ient
  • Loading branch information
aceforeverd committed Apr 29, 2024
1 parent d9bb344 commit 920db99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sdk/sql_cluster_router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include "sdk/split.h"
#include "udf/udf.h"
#include "vm/catalog.h"
#include "vm/engine.h"

DECLARE_string(bucket_size);
DECLARE_uint32(replica_num);
Expand Down Expand Up @@ -2861,7 +2862,12 @@ std::shared_ptr<hybridse::sdk::ResultSet> SQLClusterRouter::ExecuteSQL(
}
case hybridse::node::kPlanTypeFuncDef:
case hybridse::node::kPlanTypeQuery: {
if (!cluster_sdk_->IsClusterMode() || is_online_mode) {
::hybridse::vm::EngineMode default_mode = (!cluster_sdk_->IsClusterMode() || is_online_mode)
? ::hybridse::vm::EngineMode::kBatchMode
: ::hybridse::vm::EngineMode::kOffline;
// execute_mode in query config clause takes precedence
auto mode = ::hybridse::vm::Engine::TryDetermineEngineMode(sql, default_mode);
if (mode != ::hybridse::vm::EngineMode::kOffline) {
// Run online query
return ExecuteSQLParameterized(db, sql, parameter, status);
} else {
Expand Down

0 comments on commit 920db99

Please sign in to comment.