Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support set global variable #1359

Merged
merged 21 commits into from
Mar 16, 2022
Merged

Conversation

keyu813
Copy link
Contributor

@keyu813 keyu813 commented Mar 1, 2022

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    feature:
    support set@@global.xxx = xxx & set GLOBAL xxx = xxx for Add global variable table #1257

企业微信截图_8b8e5800-c06d-4f23-9b36-23b0cedc0203

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2022

Linux Test Report

       51 files       177 suites   39m 37s ⏱️
  8 493 tests   8 493 ✔️ 0 💤 0
12 594 runs  12 594 ✔️ 0 💤 0

Results for commit 4e9da67.

♻️ This comment has been updated with latest results.

src/sdk/sql_cluster_router.cc Outdated Show resolved Hide resolved
src/sdk/sql_cluster_router.cc Outdated Show resolved Hide resolved
src/sdk/sql_cluster_router.cc Outdated Show resolved Hide resolved
@keyu813 keyu813 force-pushed the issue1257_ branch 2 times, most recently from 2722219 to 246c135 Compare March 10, 2022 08:25
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #1359 (4e9da67) into main (c473ddb) will increase coverage by 0.00%.
The diff coverage is 92.30%.

@@            Coverage Diff            @@
##               main    #1359   +/-   ##
=========================================
  Coverage     66.03%   66.04%           
  Complexity      277      277           
=========================================
  Files           571      571           
  Lines        107721   107801   +80     
  Branches        904      904           
=========================================
+ Hits          71136    71196   +60     
- Misses        36393    36413   +20     
  Partials        192      192           
Impacted Files Coverage Δ
src/sdk/db_sdk.h 76.66% <0.00%> (-1.30%) ⬇️
src/sdk/sql_cluster_router.h 66.66% <ø> (ø)
src/tablet/tablet_impl.h 100.00% <ø> (ø)
src/sdk/sql_cluster_router.cc 43.97% <85.71%> (-0.10%) ⬇️
src/tablet/tablet_impl.cc 38.69% <85.71%> (+0.22%) ⬆️
src/cmd/sql_cmd_test.cc 100.00% <100.00%> (ø)
src/sdk/db_sdk.cc 64.07% <100.00%> (-0.18%) ⬇️
src/client/tablet_client.cc 35.25% <0.00%> (-0.22%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c473ddb...4e9da67. Read the comment docs.

src/sdk/db_sdk.cc Outdated Show resolved Hide resolved
src/tablet/tablet_impl.cc Outdated Show resolved Hide resolved
src/sdk/sql_cluster_test.cc Outdated Show resolved Hide resolved
src/sdk/sql_cluster_test.cc Outdated Show resolved Hide resolved
src/sdk/sql_cluster_router.cc Outdated Show resolved Hide resolved
tables.clear();

::hybridse::sdk::Status status;
std::string sql = "set @@global.enable_trace='true';";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test SET GLOBAL as well

@dl239
Copy link
Collaborator

dl239 commented Mar 15, 2022

PR review meeting note:

  • Modify notify path
  • Rename the db_
  • Recover the global variables after tablet startup
  • Init global/session variables from system table in sdk

@github-actions
Copy link
Contributor

github-actions bot commented Mar 15, 2022

SDK Test Report

  67 files    67 suites   5m 7s ⏱️
147 tests 144 ✔️ 3 💤 0
180 runs  177 ✔️ 3 💤 0

Results for commit 4e9da67.

♻️ This comment has been updated with latest results.

src/sdk/db_sdk.h Outdated Show resolved Hide resolved
src/sdk/sql_cluster_test.cc Outdated Show resolved Hide resolved
@aceforeverd aceforeverd enabled auto-merge (squash) March 16, 2022 09:47
@aceforeverd aceforeverd added the enhancement New feature or request label Mar 16, 2022
@aceforeverd aceforeverd added this to the v0.5 milestone Mar 16, 2022
@@ -96,6 +97,11 @@ bool ClusterSDK::TriggerNotify() const {
return zk_client_->Increment(notify_path_);
}

bool ClusterSDK::GlobalVarNotify() const {
LOG(INFO) << "Global variable changed trigger notify node";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove or set as DLOG

@@ -123,6 +123,7 @@ class DBSDK {
std::string* msg);
std::vector<std::shared_ptr<hybridse::sdk::ProcedureInfo>> GetProcedureInfo(std::string* msg);
virtual bool TriggerNotify() const = 0;
virtual bool GlobalVarNotify() const = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call TriggerNotify as different notify_type. can do later

@aceforeverd aceforeverd merged commit e1902c9 into 4paradigm:main Mar 16, 2022
@keyu813
Copy link
Contributor Author

keyu813 commented Mar 28, 2022

global variable support

@lumianph lumianph mentioned this pull request May 13, 2022
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants