-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix][Connector] Fix presto connector execute error & target table co…
…unt error (#299)
- Loading branch information
Showing
51 changed files
with
353 additions
and
161 deletions.
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
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
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
27 changes: 27 additions & 0 deletions
27
...or/datavines-connector-api/src/main/java/io/datavines/connector/api/DataSourceClient.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,27 @@ | ||
package io.datavines.connector.api; | ||
|
||
import io.datavines.common.datasource.jdbc.BaseJdbcDataSourceInfo; | ||
import org.springframework.jdbc.core.JdbcTemplate; | ||
|
||
import javax.sql.DataSource; | ||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
import java.util.Map; | ||
import java.util.Properties; | ||
|
||
public interface DataSourceClient { | ||
|
||
DataSource getDataSource(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException; | ||
|
||
DataSource getDataSource(Map<String,Object> configMap) throws SQLException; | ||
|
||
DataSource getDataSource(Properties properties) throws SQLException; | ||
|
||
Connection getConnection(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException; | ||
|
||
Connection getConnection(Map<String,Object> configMap) throws SQLException; | ||
|
||
Connection getConnection(Properties properties) throws SQLException; | ||
|
||
JdbcTemplate getJdbcTemplate(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException; | ||
} |
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
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
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
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
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
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
52 changes: 52 additions & 0 deletions
52
...ines-connector-jdbc/src/main/java/io/datavines/connector/plugin/JdbcDataSourceClient.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,52 @@ | ||
package io.datavines.connector.plugin; | ||
|
||
import io.datavines.common.datasource.jdbc.BaseJdbcDataSourceInfo; | ||
import io.datavines.common.datasource.jdbc.JdbcDataSourceManager; | ||
import io.datavines.connector.api.DataSourceClient; | ||
import org.springframework.jdbc.core.JdbcTemplate; | ||
|
||
import javax.sql.DataSource; | ||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
import java.util.Map; | ||
import java.util.Properties; | ||
|
||
public class JdbcDataSourceClient implements DataSourceClient { | ||
|
||
@Override | ||
public DataSource getDataSource(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException { | ||
return JdbcDataSourceManager.getInstance().getDataSource(baseJdbcDataSourceInfo); | ||
} | ||
|
||
@Override | ||
public DataSource getDataSource(Map<String, Object> configMap) throws SQLException { | ||
return JdbcDataSourceManager.getInstance().getDataSource(configMap); | ||
} | ||
|
||
@Override | ||
public DataSource getDataSource(Properties properties) throws SQLException { | ||
return JdbcDataSourceManager.getInstance().getDataSource(properties); | ||
} | ||
|
||
@Override | ||
public Connection getConnection(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException { | ||
return JdbcDataSourceManager.getInstance().getDataSource(baseJdbcDataSourceInfo).getConnection(); | ||
} | ||
|
||
@Override | ||
public Connection getConnection(Map<String, Object> configMap) throws SQLException { | ||
return JdbcDataSourceManager.getInstance().getDataSource(configMap).getConnection(); | ||
} | ||
|
||
@Override | ||
public Connection getConnection(Properties properties) throws SQLException { | ||
return JdbcDataSourceManager.getInstance().getDataSource(properties).getConnection(); | ||
} | ||
|
||
@Override | ||
public JdbcTemplate getJdbcTemplate(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException { | ||
JdbcTemplate jdbcTemplate = new JdbcTemplate(JdbcDataSourceManager.getInstance().getDataSource(baseJdbcDataSourceInfo)); | ||
jdbcTemplate.setFetchSize(500); | ||
return jdbcTemplate; | ||
} | ||
} |
Oops, something went wrong.