class CleanTableFunction implements Function<TableAndMetadata, TableAndMetadata> {

  @Override
  public TableAndMetadata apply(TableAndMetadata tableAndMetadata) {
    if (tableAndMetadata == null) {
      return null;
    }

    Table tableCopy = tableAndMetadata.getTable().deepCopy();
    for (CircusTrainTableParameter p : CircusTrainTableParameter.values()) {
      tableCopy.getParameters().remove(p.parameterName());
    }
    for (ExcludedHiveParameter p : ExcludedHiveParameter.values()) {
      tableCopy.getParameters().remove(p.parameterName());
    }
    return new TableAndMetadata(tableAndMetadata.getSourceTable(), tableAndMetadata.getSourceLocation(), tableCopy);
  }

}