You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/02/11 03:34:42 UTC

[GitHub] [hive] baifachuan edited a comment on pull request #3009: HIVE-25912: Drop external table throw NPE if the location set to ROOT…

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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org