wecharyu commented on code in PR #4480:
URL: https://github.com/apache/hive/pull/4480#discussion_r1266953733
##########
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitionsFromPartSpec.java:
##########
@@ -265,18 +265,17 @@ public void
testAddPartitionSpecUpperCaseDBAndTableNameInOnePart() throws Except
String rootPath = tableLocation + "/addpartspectest/";
PartitionSpecProxy partitionSpec = buildPartitionSpec(DB_NAME, tableName,
rootPath, partitions);
- client.add_partitions_pspec(partitionSpec);
+ try {
+ client.add_partitions_pspec(partitionSpec);
+ Assert.fail("MetaException should have been thrown.");
+ } catch (MetaException e) {
+ // Expected exception
+ System.out.println(e);
Review Comment:
Replace it with an exception message check.
##########
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitionsFromPartSpec.java:
##########
@@ -265,18 +265,17 @@ public void
testAddPartitionSpecUpperCaseDBAndTableNameInOnePart() throws Except
String rootPath = tableLocation + "/addpartspectest/";
PartitionSpecProxy partitionSpec = buildPartitionSpec(DB_NAME, tableName,
rootPath, partitions);
- client.add_partitions_pspec(partitionSpec);
+ try {
+ client.add_partitions_pspec(partitionSpec);
+ Assert.fail("MetaException should have been thrown.");
+ } catch (MetaException e) {
+ // Expected exception
+ System.out.println(e);
+ }
- Partition part = client.getPartition(DB_NAME, tableName, "year=2013");
- Assert.assertNotNull(part);
- Assert.assertEquals(tableName, part.getTableName());
- Assert.assertEquals(DB_NAME, part.getDbName());
- Assert.assertEquals(tableLocation + "/year=2013",
part.getSd().getLocation());
- part = client.getPartition(DB_NAME, tableName, "year=2014");
- Assert.assertNotNull(part);
- Assert.assertEquals(tableName, part.getTableName());
- Assert.assertEquals(DB_NAME, part.getDbName());
- Assert.assertEquals(tableLocation + "/year=2014",
part.getSd().getLocation());
+ List<String> partitionNames = client.listPartitionNames(DB_NAME,
tableName, MAX);
Review Comment:
After we reuse `add_partitions_core` function for `add_partitions_pspec`
api, it will fail for the unmatched UpperCase db and table name, so actually we
will not add these partitions in this test, so I remove those test lines.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]