package com.airbnb.aerosolve.core.transforms;

import com.airbnb.aerosolve.core.FeatureVector;

import java.util.Map;
import java.util.Set;

import com.typesafe.config.Config;

/**
 * "field1" specifies the string column to be deleted
 */
public class DeleteStringFeatureFamilyTransform implements Transform {
  private String fieldName1;

  @Override
  public void configure(Config config, String key) {
    fieldName1 = config.getString(key + ".field1");
  }

  @Override
  public void doTransform(FeatureVector featureVector) {
    Map<String, Set<String>> stringFeatures = featureVector.getStringFeatures();
    if (stringFeatures == null) {
      return ;
    }

    Set<String> feature1 = stringFeatures.get(fieldName1);
    if (feature1 == null) {
      return;
    }

    stringFeatures.remove(fieldName1);
  }
}

@@ -89,16 +89,65 @@
 ector;%0A%0A
+import java.util.HashSet;%0Aimport java.util.List;%0A
 import j
@@ -380,16 +380,51 @@
 ldName1;
+%0A  private List%3CString%3E fieldNames;
 %0A%0A  @Ove
@@ -478,24 +478,69 @@
 ring key) %7B%0A
+    if (config.hasPath(key + %22.field1%22)) %7B%0A  
     fieldNam
@@ -579,16 +579,129 @@
 eld1%22);%0A
+    %7D%0A    if (config.hasPath(key + %22.fields%22)) %7B%0A      fieldNames = config.getStringList(key + %22.fields%22);%0A    %7D%0A
   %7D%0A%0A  @
@@ -899,24 +899,274 @@
 rn ;%0A    %7D%0A%0A
+    HashSet%3CString%3E fieldNamesSet = new HashSet%3C%3E();%0A%0A    if (fieldName1 != null) %7B%0A      fieldNamesSet.add(fieldName1);%0A    %7D%0A    if (fieldNames != null) %7B%0A      fieldNamesSet.addAll(fieldNames);%0A    %7D%0A%0A    for (String fieldName: fieldNamesSet) %7B%0A  
     Set%3CStri
@@ -1212,24 +1212,26 @@
 Name1);%0A    
+ 
+ 
 if (feature1
@@ -1231,17 +1231,17 @@
 eature1 
-=
+!
 = null) 
@@ -1250,25 +1250,8 @@
     
-  return;%0A    %7D%0A%0A
     
@@ -1281,18 +1281,31 @@
 ieldName
-1
 );%0A
+      %7D%0A    %7D%0A
   %7D%0A%7D%0A

Add ability to delete multiple string familes at once