Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Mar 5, 2024
1 parent 41929d3 commit 905d9ff
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ public void testAutoAddTable() throws Exception {
}

private void initializeDorisTable() throws Exception {
try (Statement statement = connection.createStatement()) {
try (Connection connection =
DriverManager.getConnection(
String.format(URL, DORIS_CONTAINER.getHost()), USERNAME, PASSWORD);
Statement statement = connection.createStatement()) {
statement.execute(String.format("DROP TABLE IF EXISTS %s.%s", DATABASE, TABLE_1));
statement.execute(String.format("DROP TABLE IF EXISTS %s.%s", DATABASE, TABLE_2));
statement.execute(String.format("DROP TABLE IF EXISTS %s.%s", DATABASE, TABLE_3));
Expand All @@ -287,8 +290,11 @@ private void initializeDorisTable() throws Exception {
public void checkResult(Set<List<Object>> expected, String query, int columnSize)
throws Exception {
Set<List<Object>> actual = new HashSet<>();
try (Statement sinkStatement = connection.createStatement()) {
ResultSet sinkResultSet = sinkStatement.executeQuery(query);
try (Connection connection =
DriverManager.getConnection(
String.format(URL, DORIS_CONTAINER.getHost()), USERNAME, PASSWORD);
Statement statement = connection.createStatement()) {
ResultSet sinkResultSet = statement.executeQuery(query);
while (sinkResultSet.next()) {
List<Object> row = new ArrayList<>();
for (int i = 1; i <= columnSize; i++) {
Expand Down

0 comments on commit 905d9ff

Please sign in to comment.