-
Notifications
You must be signed in to change notification settings - Fork 30
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: flink sql add create space #66
Conversation
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
=============================================
+ Coverage 49.72% 61.54% +11.82%
- Complexity 190 291 +101
=============================================
Files 50 52 +2
Lines 1613 1784 +171
Branches 153 166 +13
=============================================
+ Hits 802 1098 +296
+ Misses 743 596 -147
- Partials 68 90 +22
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Refer to Flink SQL doc and Nebula doc. CREATE DATABASE [IF NOT EXISTS] [catalog_name.]db_name
[COMMENT database_comment]
WITH (key1=val1, key2=val2, ...) CREATE SPACE [IF NOT EXISTS] <graph_space_name> (
[partition_num = <partition_number>,]
[replica_factor = <replica_number>,]
vid_type = {FIXED_STRING(<N>) | INT[64]}
)
[COMMENT = '<comment>']; I register the Test Environment: Windows Virtual Machine(Centos7), Nebula is deployed by Docker. And result is just as follow: |
* @param b true if contains [if not exists] else false | ||
*/ | ||
@Override | ||
public void createDatabase(String s, CatalogDatabase catalogDatabase, boolean b) |
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.
please use more meaningful variable name for s and b.
eg: dataBaseName, useIfNotExists
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.
sure, these variable name is so bad. I'll change them. And should i change the variable names in the method it inherits.
In AbstractNebulaCatalog
, the method definition looks like this:
@Override
public void createDatabase(String s, CatalogDatabase catalogDatabase, boolean b)
throws CatalogException {
throw new UnsupportedOperationException();
}
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.
great catch, the parent method has bad variable names, please change it too, thanks.
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.
Sorry for my late reply, this week i am many other things to do, i am glad to do this as soon as possible
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.
This 9e2c2b5 commit update the bad variable names in AbstractNebulaCatalog
LOG.debug("create space success."); | ||
} else { | ||
LOG.error("create space failed: {}", execResult.getErrorMessage()); | ||
throw new CatalogException("create space failed."); |
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.
append the error message of execResult
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 means to append execResult error message to CatalogException message?
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.
yeah
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.
got it, e23cdfd should sovle this i think, thanks for your kindly suggestion.
checkArgument( | ||
!StringUtils.isNullOrWhitespaceOnly(address), | ||
"address cannot be null or empty." | ||
); |
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.
thanks for the todo work
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.
my pleasure.
!isNullOrWhitespaceOnly(dataBaseName), "space name cannot be null or empty."); | ||
checkNotNull(catalogDatabase, "space cannot be null."); | ||
|
||
if (ignoreIfExists && listDatabases().contains(dataBaseName)) { |
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.
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.
sure, there are indeed logical inconsistencies, i'll fix it.
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.
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 think that's fine, thanks for this kindly log info.
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
Try to close #62.