package io.ddf.facades;


import io.ddf.DDF;
import io.ddf.etl.IHandleTransformations;
import io.ddf.exception.DDFException;

import java.util.List;

public class TransformFacade implements IHandleTransformations {
  private DDF mDDF;
  private IHandleTransformations mTransformationHandler;

  {

  }

  public TransformFacade(DDF ddf, IHandleTransformations transformationHandler) {
    this.mDDF = ddf;
    this.mTransformationHandler = transformationHandler;
  }

  @Override
  public DDF getDDF() {
    return mDDF;
  }

  @Override
  public void setDDF(DDF theDDF) {
    mDDF = theDDF;
  }

  public IHandleTransformations getmTransformationHandler() {
    return mTransformationHandler;
  }

  public void setmTransformationHandler(IHandleTransformations mTransformationHandler) {
    this.mTransformationHandler = mTransformationHandler;
  }

  public DDF transformMapReduceNative(String mapFuncDef, String reduceFuncDef) {
    return transformMapReduceNative(mapFuncDef, reduceFuncDef, true);

  }

  @Override
  public DDF transformMapReduceNative(String mapFuncDef, String reduceFuncDef, boolean mapsideCombine) {
    return mTransformationHandler.transformMapReduceNative(mapFuncDef, reduceFuncDef, mapsideCombine);

  }

  @Override
  public DDF transformNativeRserve(String transformExpression) {
    return mTransformationHandler.transformNativeRserve(transformExpression);

  }

  @Override
  public DDF transformScaleMinMax() throws DDFException {
    return mTransformationHandler.transformScaleMinMax();
  }

  @Override
  public DDF transformScaleStandard() throws DDFException {
    return mTransformationHandler.transformScaleStandard();
  }

  @Override
  public DDF transformUDF(String transformExpression, List<String> columns) throws DDFException {
    return mTransformationHandler.transformUDF(transformExpression, columns);
  }


  public DDF transformUDF(String transformExpression) throws DDFException {
    return transformUDF(transformExpression, null);
  }
}

@@ -1983,11 +1983,194 @@
 ll);%0A  %7D
+%0A%0A  public DDF flattenDDF(List%3CString%3E columns) throws DDFException %7B%0A    return flattenDDF(columns);%0A  %7D%0A%0A  public DDF flattenDDF() throws DDFException %7B%0A    return flattenDDF();%0A  %7D
 %0A%7D%0A

fix bugs