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

JDBC connector spark_options should provide all the properties #214

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public Map<String, String> getSparkOptions() throws FeatureStoreException {
}

@JsonIgnore
private Map<String, String> getJdbcOptions() throws FeatureStoreException {
private Map<String, String> getJdbcOptions() {
Map<String, String> options = Arrays.stream(arguments.split(","))
.map(arg -> arg.split("="))
.collect(Collectors.toMap(a -> a[0], a -> a[1]));
Expand Down
12 changes: 5 additions & 7 deletions python/hsfs/storage_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ def arguments(self):

@property
def path(self):
"""If the connector refers to a path (e.g. S3) - return the path of the connector
"""
"""If the connector refers to a path (e.g. S3) - return the path of the connector"""
if self._storage_connector_type.upper() == "S3":
return "s3://" + self._bucket
else:
Expand All @@ -338,11 +337,10 @@ def spark_options(self):
if self._storage_connector_type.upper() == "JDBC":
args = [arg.split("=") for arg in self._arguments.split(",")]

return {
"url": self._connection_string,
"user": [arg[1] for arg in args if arg[0] == "user"][0],
"password": [arg[1] for arg in args if arg[0] == "password"][0],
}
options = {a[0]: a[1] for a in args}
options["url"] = self._connection_string

return options
elif self._storage_connector_type.upper() == "REDSHIFT":
connstr = (
"jdbc:redshift://"
Expand Down