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

[Improve][Jdbc] Improve catalog connection cache #8626

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

hailin0
Copy link
Member

@hailin0 hailin0 commented Feb 8, 2025

Purpose of this pull request

[Jdbc] Improve catalog connection cache

Does this PR introduce any user-facing change?

No

How was this patch tested?

Check list

@@ -360,20 +356,6 @@ public List<String> listViews(String databaseName)
}
}

public List<String> listSynonym(String databaseName)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to saphana catalog


@Slf4j
public class RedshiftCatalog extends AbstractJdbcCatalog {

private final String SELECT_COLUMNS =
"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME ='%s' ORDER BY ordinal_position ASC";

protected final Map<String, Connection> connectionMap;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove duplicate code

@@ -204,55 +204,53 @@ protected String getDropDatabaseSql(String databaseName) {

@Override
public CatalogTable getTable(String sqlQuery) throws SQLException {
try (Connection connection = getConnection(defaultUrl)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache closed connection

@wuchunfu wuchunfu merged commit 6205065 into apache:dev Feb 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants