-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for hybrid index ddl #737
Conversation
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.
LGTM, couple nits. (I also really like the USING syntax.)
@@ -503,6 +512,13 @@ struct create_relationship_t : create_statement_t | |||
// A relationship is defined by a pair of links because we only allow | |||
// bi-directional relationships. | |||
std::pair<link_def_t, link_def_t> relationship; | |||
|
|||
// Track the optional mapping from one table's field(s) to the other table's | |||
// field(s). The field map must be bijective or have 1:1 correspondence from |
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.
"bijective or 1:1" is a little confusing since they're synonymous.
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.
Though it makes sense for those that knew them before they were synonymous. ;)
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.
Actually now that I think about it, "1:1" is ambiguous between "injective" and "bijective" (I think I've seen it used in both senses in math).
{ | ||
parser_t parser; | ||
|
||
const string create_relationship_ddl = R"( |
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.
I didn't know C++ had raw strings, this is really useful!
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.
Other than the typo pointed out by Tobin LGTM
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.
LGTM
@@ -503,6 +512,12 @@ struct create_relationship_t : create_statement_t | |||
// A relationship is defined by a pair of links because we only allow | |||
// bi-directional relationships. | |||
std::pair<link_def_t, link_def_t> relationship; | |||
|
|||
// Track the optional mapping from one table's field(s) to the other table's |
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.
Nit: the mapping is required to specify a hybrid index, right? I can't create a hybrid index without the mapping, correct?
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.
It is optional in the sense the relationship can still be created with gaia_id without the USING
clause.
After some discussion with @daxhaw, we have settled on the "CREATE RELATIONSHIP ... USING" for hybrid index DDL. To create a relationship with hybrid index, users need to add the optional "USING" clause at the end of the "CREATE RELATIONSHIP" statement. Here is an example: