@Override
  public GenericRow transform(GenericRow record) {
    for (Map.Entry<String, FunctionEvaluator> entry : _expressionEvaluators.entrySet()) {
      String column = entry.getKey();
      FunctionEvaluator transformFunctionEvaluator = entry.getValue();
      Object existingValue = record.getValue(column);
      if (existingValue == null) {
        try {
          // Skip transformation if column value already exists
          // NOTE: column value might already exist for OFFLINE data,
          // For backward compatibility, The only exception here is that we will override nested field like array,
          // collection or map since they were not included in the record transformation before.
          record.putValue(column, transformFunctionEvaluator.evaluate(record));
        } catch (Exception e) {
          if (!_continueOnError) {
            throw new RuntimeException("Caught exception while evaluation transform function for column: " + column, e);
          } else {
            LOGGER.debug("Caught exception while evaluation transform function for column: {}", column, e);
            record.putValue(GenericRow.INCOMPLETE_RECORD_KEY, true);
          }
        }
      } else if (existingValue.getClass().isArray() || existingValue instanceof Collections
          || existingValue instanceof Map) {
        try {
          Object transformedValue = transformFunctionEvaluator.evaluate(record);
          // For backward compatibility, The only exception here is that we will override nested field like array,
          // collection or map since they were not included in the record transformation before.
          if (!isTypeCompatible(existingValue, transformedValue)) {
            record.putValue(column, transformedValue);
          }
        } catch (Exception e) {
          LOGGER.debug("Caught exception while evaluation transform function for column: {}", column, e);
        }
      }
    }
    return record;
  }
@Test
  public void testTransformFunctionSortOrder() {
    Schema schema = new Schema.SchemaBuilder().addSingleValueDimension("a", FieldSpec.DataType.STRING)
        .addSingleValueDimension("b", FieldSpec.DataType.STRING).addSingleValueDimension("c", FieldSpec.DataType.STRING)
        .addSingleValueDimension("d", FieldSpec.DataType.STRING).addSingleValueDimension("e", FieldSpec.DataType.STRING)
        .addSingleValueDimension("f", FieldSpec.DataType.STRING).build();
    List<TransformConfig> transformConfigs = Arrays.asList(
        new TransformConfig("d", "plus(x, 10)"),
        new TransformConfig("b", "plus(d, 10)"),
        new TransformConfig("a", "plus(b, 10)"),
        new TransformConfig("c", "plus(a, d)"),
        new TransformConfig("f", "plus(e, 10)"));
    IngestionConfig ingestionConfig = new IngestionConfig();
    ingestionConfig.setTransformConfigs(transformConfigs);
    TableConfig tableConfig = new TableConfigBuilder(TableType.OFFLINE).setTableName("testDerivedFunctions")
        .setIngestionConfig(ingestionConfig).build();
    ExpressionTransformer expressionTransformer = new ExpressionTransformer(tableConfig, schema);
    GenericRow genericRow = new GenericRow();
    genericRow.putValue("x", 100);
    genericRow.putValue("e", 200);
    GenericRow transform = expressionTransformer.transform(genericRow);
    Assert.assertEquals(transform.getValue("a"), 130.0);
    Assert.assertEquals(transform.getValue("b"), 120.0);
    Assert.assertEquals(transform.getValue("c"), 240.0);
    Assert.assertEquals(transform.getValue("d"), 110.0);
    Assert.assertEquals(transform.getValue("e"), 200);
    Assert.assertEquals(transform.getValue("f"), 210.0);
  }