luoyuxia commented on code in PR #19218:
URL: https://github.com/apache/flink/pull/19218#discussion_r914748875
##########
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveDialectQueryITCase.java:
##########
@@ -330,6 +330,22 @@ public void testJoinInvolvingComplexType() throws
Exception {
}
}
+ @Test
+ public void testCurrentDatabase() {
+ List<Row> result =
+ CollectionUtil.iteratorToList(
+ tableEnv.executeSql("select
current_database()").collect());
+ assertThat(result.toString()).isEqualTo("[+I[default]]");
+ tableEnv.executeSql("create database db1");
+ tableEnv.executeSql("use db1");
+ result =
+ CollectionUtil.iteratorToList(
+ tableEnv.executeSql("select
current_database()").collect());
+ assertThat(result.toString()).isEqualTo("[+I[db1]]");
+ // switch to default database for following test use default database
+ tableEnv.executeSql("use default");
Review Comment:
I think we don't need to add a `cleanup` method for currently only one test
needs it. It would be better to limit it in this single test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]