KurtYoung commented on a change in pull request #15549:
URL: https://github.com/apache/flink/pull/15549#discussion_r613734122
##########
File path:
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/TableEnvHiveConnectorITCase.java
##########
@@ -442,6 +448,41 @@ public void testDynamicPartWithOrderBy() throws Exception {
}
}
+ @Test
+ public void testLocationWithComma() throws Exception {
+ TableEnvironment tableEnv = getTableEnvWithHiveCatalog();
+ File location = tempFolder.newFolder(",tbl1,location,");
+ try {
+ // test table location
+ tableEnv.executeSql(
+ String.format(
+ "create table tbl1 (x int) location '%s'",
location.getAbsolutePath()));
+ tableEnv.executeSql("insert into tbl1 values (1),(2)").await();
+ List<Row> results =
+ CollectionUtil.iteratorToList(
+ tableEnv.executeSql("select * from
tbl1").collect());
+ assertEquals("[+I[1], +I[2]]", results.toString());
+ // test partition location
+ tableEnv.executeSql("create table tbl2 (x int) partitioned by (p
string)");
+ location = tempFolder.newFolder(",");
+ tableEnv.executeSql(
+ String.format(
+ "alter table tbl2 add partition (p='a') location
'%s'",
Review comment:
According to the jira description, I was assuming that you want to
address both of these
##########
File path:
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/TableEnvHiveConnectorITCase.java
##########
@@ -442,6 +448,41 @@ public void testDynamicPartWithOrderBy() throws Exception {
}
}
+ @Test
+ public void testLocationWithComma() throws Exception {
+ TableEnvironment tableEnv = getTableEnvWithHiveCatalog();
+ File location = tempFolder.newFolder(",tbl1,location,");
+ try {
+ // test table location
+ tableEnv.executeSql(
+ String.format(
+ "create table tbl1 (x int) location '%s'",
location.getAbsolutePath()));
+ tableEnv.executeSql("insert into tbl1 values (1),(2)").await();
+ List<Row> results =
+ CollectionUtil.iteratorToList(
+ tableEnv.executeSql("select * from
tbl1").collect());
+ assertEquals("[+I[1], +I[2]]", results.toString());
+ // test partition location
+ tableEnv.executeSql("create table tbl2 (x int) partitioned by (p
string)");
+ location = tempFolder.newFolder(",");
+ tableEnv.executeSql(
+ String.format(
+ "alter table tbl2 add partition (p='a') location
'%s'",
Review comment:
According to the jira description, I was assuming that you want to
address both of them
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]