-
Notifications
You must be signed in to change notification settings - Fork 92
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: multiple sharding keys implementation #681
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #681 +/- ##
==========================================
+ Coverage 36.42% 38.54% +2.12%
==========================================
Files 228 235 +7
Lines 23759 26035 +2276
==========================================
+ Hits 8654 10035 +1381
- Misses 14106 14916 +810
- Partials 999 1084 +85
☔ View full report in Codecov by Sentry. |
- columns: | ||
- name: uid | ||
- name: friend_id | ||
expr: parseInt(($0*31+$1) % 32 / 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the meaing of $0+31
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The $index
means the column of target index, and $0*31+$1
is equals with valueOf(uid) * 31 + valueOf(friend_id)
. BTW, it's just an example which show how the new expression works.
- column: uid | ||
type: scriptExpr | ||
- columns: | ||
- name: uid | ||
expr: parseInt($value % 32 / 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the placeholder $0 not used here, but $value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be compatible with the old expression design, $value
is the alias of $0
.
@maronghe hey, guy, the ci failed. |
f69708c
to
a1559e3
Compare
a1559e3
to
fe16cd4
Compare
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
fe16cd4
to
a9c4d9c
Compare
@@ -104,6 +108,16 @@ func (to *Topology) Enumerate() DatabaseTables { | |||
return dt | |||
} | |||
|
|||
func (to *Topology) Exists(dbIdx, tbIdx int) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not Exist
?
done |
* composite_sharding (arana-db#665) * feat: support multiple shard keys --------- Co-authored-by: binbin.zhang <binbin0325@apache.org>
What this PR does:
logic
andcalculus
.Which issue(s) this PR fixes:
Fixes #425
Special notes for your reviewer:
Does this PR introduce a user-facing change?: