Skip to content

Commit 5d3c8ce

Browse files
committed
Added db to sql when creating or dropping table.
1 parent 608b071 commit 5d3c8ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flink-connector-clickhouse-base/src/test/java/org/apache/flink/connector/clickhouse/sink/ClickHouseSinkTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ private int executeJob(StreamExecutionEnvironment env, String tableName) throws
4747
void CSVDataTest() throws Exception {
4848
//String path = ClickHouseSinkTests.class.getClassLoader().getResource(".").toString();
4949
String tableName = "csv_covid";
50-
String dropTable = "drop table if exists " + tableName;
50+
String dropTable = String.format("DROP TABLE IF EXISTS `%s`.`%s`", getDatabase(), tableName);
5151
ClickHouseServerForTests.executeSql(dropTable);
5252
// create table
53-
String tableSql = "CREATE TABLE " + tableName + " (" +
53+
String tableSql = "CREATE TABLE `" + getDatabase() + "`.`" + tableName + "` (" +
5454
"date Date," +
5555
"location_key LowCardinality(String)," +
5656
"new_confirmed Int32," +

0 commit comments

Comments
 (0)