-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Feature][plugin] Add snowflake datasource in datasource plugin #13729
Merged
Merged
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6bcafee
[Feature][plugin] Add snowflake datasource in datasource plugin
zhaohehuhu cd4af90
[Feature][ui] add snowflake datasource plugin
tongwl 7cc88ca
apply spotless
zhaohehuhu 6c4251d
[Feature][plugin] Add snowflake datasource in datasource plugin
zhaohehuhu 8a0d208
[Feature][ui] add snowflake datasource plugin
tongwl 19b6b4b
apply spotless
zhaohehuhu 6355fb5
Merge remote-tracking branch 'origin/Feature-13727' into Feature-13727
zhaohehuhu 6bc1896
fix snowflake dependency
zhaohehuhu 29dffda
Add snowflake license
zhaohehuhu 5585abc
delete extra snowflake dependency
zhaohehuhu ed97a09
add more UT
zhaohehuhu 9896fc6
delete duplicated version
zhaohehuhu 47b9843
Merge branch 'dev' of github.com:apache/dolphinscheduler into Feature…
zhaohehuhu 2cc2824
add doc link
zhaohehuhu fbf89c1
reformat code
zhaohehuhu b4b6904
Merge remote-tracking branch 'ds/dev' into Feature-13727
zhaohehuhu 4bbe2d9
add more UTs
zhaohehuhu 58e4962
Merge remote-tracking branch 'ds/dev' into Feature-13727
zhaohehuhu 6245e2f
add UTs
zhaohehuhu a4b04ca
add a blank after SNOWFLAKE
zhaohehuhu 97af859
Merge remote-tracking branch 'ds/dev' into Feature-13727
zhaohehuhu 4f1d478
fix UT
zhaohehuhu 2da6fd5
Merge remote-tracking branch 'ds/dev' into Feature-13727
zhaohehuhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SNOWFLAKE | ||
|
||
## Use Snowflake | ||
|
||
![snowflake](../../../../img/new_ui/dev/datasource/snowflake.png) | ||
|
||
## Datasource Parameters | ||
|
||
| **Datasource** | **Description** | | ||
|----------------------------|--------------------------------------------------------------| | ||
| Datasource | Select SNOWFLAKE. | | ||
| Datasource name | Enter the name of the DataSource. | | ||
| Description | Enter a description of the DataSource. | | ||
| IP/Host Name | Enter the SNOWFLAKE service IP. | | ||
| Port | Enter the SNOWFLAKE service port. | | ||
| Username | Set the username for SNOWFLAKE connection. | | ||
| Password | Set the password for SNOWFLAKE connection. | | ||
| Database name | Enter the database name of the SNOWFLAKE connection. | | ||
| Datawarehouse name | Enter the datawarehouse name of the SNOWFLAKE connection. | | ||
| Jdbc connection parameters | Parameter settings for SNOWFLAKE connection, in JSON format. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SNOWFLAKE数据源 | ||
|
||
![snowflake](../../../../img/new_ui/dev/datasource/snowflake.png) | ||
|
||
## 数据源参数 | ||
|
||
- 数据源:选择 SNOWFLAKE数据源 | ||
- 数据源名称:输入数据源的名称 | ||
- 描述:输入数据源的描述 | ||
- IP 主机名:输入连接 SNOWFLAKE数据源 的 IP | ||
- 端口:输入连接 SNOWFLAKE数据源 的端口 | ||
- 用户名:设置连接 SNOWFLAKE数据源 的用户名 | ||
- 密码:设置连接 SNOWFLAKE数据源 的密码 | ||
- 数据库名:输入连接 SNOWFLAKE数据源 的数据库名称 | ||
- 数据仓库: 输入数据 SNOWFLAKE的数据仓库名称 | ||
- Jdbc 连接参数:用于 SNOWFLAKE数据源 连接的参数设置,以 JSON 形式填写 | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-snowflake/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
~ (the "License"); you may not use this file except in compliance with | ||
~ the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.dolphinscheduler</groupId> | ||
<artifactId>dolphinscheduler-datasource-plugin</artifactId> | ||
<version>dev-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>dolphinscheduler-datasource-snowflake</artifactId> | ||
<packaging>jar</packaging> | ||
<name>${project.artifactId}</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.apache.dolphinscheduler</groupId> | ||
<artifactId>dolphinscheduler-spi</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.dolphinscheduler</groupId> | ||
<artifactId>dolphinscheduler-datasource-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>net.snowflake</groupId> | ||
<artifactId>snowflake-jdbc</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
31 changes: 31 additions & 0 deletions
31
...a/org/apache/dolphinscheduler/plugin/datasource/snowflake/SnowflakeDataSourceChannel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.snowflake; | ||
|
||
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam; | ||
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel; | ||
import org.apache.dolphinscheduler.spi.datasource.DataSourceClient; | ||
import org.apache.dolphinscheduler.spi.enums.DbType; | ||
|
||
public class SnowflakeDataSourceChannel implements DataSourceChannel { | ||
|
||
@Override | ||
public DataSourceClient createDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) { | ||
return new SnowflakeDataSourceClient(baseConnectionParam, dbType); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...pache/dolphinscheduler/plugin/datasource/snowflake/SnowflakeDataSourceChannelFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.snowflake; | ||
|
||
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel; | ||
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannelFactory; | ||
|
||
import com.google.auto.service.AutoService; | ||
|
||
@AutoService(DataSourceChannelFactory.class) | ||
public class SnowflakeDataSourceChannelFactory implements DataSourceChannelFactory { | ||
|
||
@Override | ||
public String getName() { | ||
return "snowflake"; | ||
} | ||
|
||
@Override | ||
public DataSourceChannel create() { | ||
return new SnowflakeDataSourceChannel(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...va/org/apache/dolphinscheduler/plugin/datasource/snowflake/SnowflakeDataSourceClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.snowflake; | ||
|
||
import org.apache.dolphinscheduler.plugin.datasource.api.client.CommonDataSourceClient; | ||
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam; | ||
import org.apache.dolphinscheduler.spi.enums.DbType; | ||
|
||
public class SnowflakeDataSourceClient extends CommonDataSourceClient { | ||
|
||
public SnowflakeDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) { | ||
super(baseConnectionParam, dbType); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...g/apache/dolphinscheduler/plugin/datasource/snowflake/param/SnowflakeConnectionParam.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.snowflake.param; | ||
|
||
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam; | ||
|
||
public class SnowflakeConnectionParam extends BaseConnectionParam { | ||
|
||
@Override | ||
public String toString() { | ||
return "SnowFlakeConnectionParam{" | ||
+ "user='" + user + '\'' | ||
+ ", password='" + password + '\'' | ||
+ ", address='" + address + '\'' | ||
+ ", database='" + database + '\'' | ||
+ ", jdbcUrl='" + jdbcUrl + '\'' | ||
+ ", driverLocation='" + driverLocation + '\'' | ||
+ ", driverClassName='" + driverClassName + '\'' | ||
+ ", validationQuery='" + validationQuery + '\'' | ||
+ ", other='" + other + '\'' | ||
+ '}'; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...pache/dolphinscheduler/plugin/datasource/snowflake/param/SnowflakeDatasourceParamDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.snowflake.param; | ||
|
||
import org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO; | ||
import org.apache.dolphinscheduler.spi.enums.DbType; | ||
|
||
public class SnowflakeDatasourceParamDTO extends BaseDataSourceParamDTO { | ||
|
||
@Override | ||
public String toString() { | ||
return "SnowFlakeDatasourceParamDTO{" | ||
+ "name='" + name + '\'' | ||
+ ", note='" + note + '\'' | ||
+ ", host='" + host + '\'' | ||
+ ", port=" + port | ||
+ ", database='" + database + '\'' | ||
+ ", userName='" + userName + '\'' | ||
+ ", password='" + password + '\'' | ||
+ ", other='" + other + '\'' | ||
+ '}'; | ||
} | ||
|
||
@Override | ||
public DbType getType() { | ||
return DbType.SNOWFLAKE; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Duplicated.