class MetastoreClientUtils {

  public static void validateTableObject(Table table, Configuration conf) throws InvalidObjectException {
    checkNotNull(table, "table cannot be null");
    checkNotNull(table.getSd(), "Table#StorageDescriptor cannot be null");

    if (!hiveShims.validateTableName(table.getTableName(), conf)) {
      throw new InvalidObjectException(table.getTableName() + " is not a valid object name");
    }
    String validate = MetaStoreUtils.validateTblColumns(table.getSd().getCols());
    if (validate != null) {
      throw new InvalidObjectException("Invalid column " + validate);
    }

    if (table.getPartitionKeys() != null) {
      validate = MetaStoreUtils.validateTblColumns(table.getPartitionKeys());
      if (validate != null) {
        throw new InvalidObjectException("Invalid partition column " + validate);
      }
    }
  }

  private  MetastoreClientUtils();

}