private Path getTablePath(IHMSHandler hmsHandler, Warehouse wh, Table table) throws MetaException {
    Path tablePath = null;
    try {
      if (table.getSd().getLocation() == null || table.getSd().getLocation().isEmpty()) {
        String catName = getTableCatalog(table);
        tablePath = wh.getDefaultTablePath(hmsHandler.getMS().getDatabase(
                catName, table.getDbName()), table);
      } else {
        tablePath = wh.getDnsPath(new Path(table.getSd().getLocation()));
      }
    } catch (Exception err) {
      MetaException e1 = new MetaException("Error getting table path for " + Warehouse.getQualifiedName(table));
      e1.initCause(err);
    }
    return tablePath;
  }
It's assumed everywhere that original data files are named according to
{@link #ORIGINAL_PATTERN} or{@link #ORIGINAL_PATTERN_COPY}
This checks that when transaction=true is set and throws if it finds any files that don't
follow convention.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/TransactionalValidationListener.java