baifachuan edited a comment on pull request #3009:
URL: https://github.com/apache/hive/pull/3009#issuecomment-1035851397
> @baifachuan: If you could create an end-to-end test case, then with the
green runs, I could merge your PR
I've created an E2E test case for this feature, considering the location is
`root path` not `root path`. the test case code in
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestTablesCreateDropAlterTruncate.java
```
@Test
public void testCreateTableRooPathLocationInSpecificDatabase() throws
TException {
Table table = new Table();
StorageDescriptor sd = new StorageDescriptor();
List<FieldSchema> cols = new ArrayList<>();
sd.setLocation("hdfs://localhost:8020");
table.setDbName(DEFAULT_DATABASE);
table.setTableName("test_table_2_with_path");
cols.add(new FieldSchema("column_name", "int", null));
sd.setCols(cols);
sd.setSerdeInfo(new SerDeInfo());
table.setSd(sd);
Exception exception = assertThrows(InvalidObjectException.class, () ->
client.createTable(table));
Assert.assertEquals("Storage descriptor location",
table.getTableName() + " location must not be root path",
exception.getMessage());
sd.setLocation("hdfs://localhost:8020/other_path");
client.createTable(table);
Table createdTable = client.getTable(table.getDbName(),
table.getTableName());
Assert.assertNotNull(createdTable);
client.dropTable(table.getDbName(), table.getTableName(), true, true);
}
```
Green runs on my local Hive ci.
thx.
--
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]