protected Table newTable(String dbName, String tableName, boolean partitioned,
                           Map<String, String> parameters, List<Order> sortCols,
                           boolean  isTemporary)
      throws  TException {
    Table table = new Table();
    table.setTableType(TableType.MANAGED_TABLE.name());
    table.setTableName(tableName);
    table.setDbName(dbName);
    table.setOwner("me");
    table.setSd(newStorageDescriptor(getLocation(tableName, null), sortCols));
    List<FieldSchema> partKeys = new ArrayList<>(1);
    if (partitioned) {
      partKeys.add(new FieldSchema("ds", "string", "no comment"));
      table.setPartitionKeys(partKeys);
    }

    // Set the table as transactional for compaction to work
    if (parameters == null) {
      parameters = new HashMap<>();
    }
    parameters.put(hive_metastoreConstants.TABLE_IS_TRANSACTIONAL, "true");
    if (sortCols != null) {
      // Sort columns are not allowed for full ACID table. So, change it to insert-only table
      parameters.put(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES,
              TransactionalValidationListener.INSERTONLY_TRANSACTIONAL_PROPERTY);
    }
    table.setParameters(parameters);
    if (isTemporary) {
      table.setTemporary(true);
    }

    // drop the table first, in case some previous test created it
    ms.dropTable(dbName, tableName);

    ms.createTable(table);
    return table;
  }
Super class for all of the compactor test modules.
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java