Skip to content

Commit

Permalink
fix(#3909): checkout execute_mode in config clause in sql client (#3910)
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd committed May 10, 2024
1 parent a92f187 commit 6569b42
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 @@ -2862,7 +2863,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 6569b42

Please sign in to comment.