Source:
private static void validateIngestionConfig(@Nullable IngestionConfig ingestionConfig) { if (ingestionConfig != null) { FilterConfig filterConfig = ingestionConfig.getFilterConfig(); if (filterConfig != null) { String filterFunction = filterConfig.getFilterFunction(); if (filterFunction != null) { try { FunctionEvaluatorFactory.getExpressionEvaluator(filterFunction); } catch (Exception e) { throw new IllegalStateException("Invalid filter function " + filterFunction, e); } } } List<TransformConfig> transformConfigs = ingestionConfig.getTransformConfigs(); if (transformConfigs != null) { Set<String> transformColumns = new HashSet<>(); for (TransformConfig transformConfig : transformConfigs) { String columnName = transformConfig.getColumnName(); if (transformColumns.contains(columnName)) { throw new IllegalStateException("Duplicate transform config found for column '" + columnName + "'"); } transformColumns.add(columnName); String transformFunction = transformConfig.getTransformFunction(); if (columnName == null || transformFunction == null) { throw new IllegalStateException("columnName/transformFunction cannot be null in TransformConfig " + transformConfig); } FunctionEvaluator expressionEvaluator; try { expressionEvaluator = FunctionEvaluatorFactory.getExpressionEvaluator(transformFunction); } catch (Exception e) { throw new IllegalStateException( "Invalid transform function '" + transformFunction + "' for column '" + columnName + "'"); } List<String> arguments = expressionEvaluator.getArguments(); if (arguments.contains(columnName)) { throw new IllegalStateException( "Arguments of a transform function '" + arguments + "' cannot contain the destination column '" + columnName + "'"); } } } } }

Target:
private static void validateIngestionConfig(@Nullable IngestionConfig ingestionConfig) { if (ingestionConfig != null) { FilterConfig filterConfig = ingestionConfig.getFilterConfig(); if (filterConfig != null) { String filterFunction = filterConfig.getFilterFunction(); if (filterFunction != null) { try { FunctionEvaluatorFactory.getExpressionEvaluator(filterFunction); } catch (Exception e) { throw new IllegalStateException("Invalid filter function " + filterFunction, e); } } } List<TransformConfig> transformConfigs = ingestionConfig.getTransformConfigs(); if (transformConfigs != null) { Set<String> transformColumns = new HashSet<>(); Set<String> argumentColumns = new HashSet<>(); for (TransformConfig transformConfig : transformConfigs) { String columnName = transformConfig.getColumnName(); String transformFunction = transformConfig.getTransformFunction(); if (columnName == null || transformFunction == null) { throw new IllegalStateException("columnName/transformFunction cannot be null in TransformConfig " + transformConfig); } if (!transformColumns.add(columnName)) { throw new IllegalStateException("Duplicate transform config found for column '" + columnName + "'"); } FunctionEvaluator expressionEvaluator; try { expressionEvaluator = FunctionEvaluatorFactory.getExpressionEvaluator(transformFunction); } catch (Exception e) { throw new IllegalStateException( "Invalid transform function '" + transformFunction + "' for column '" + columnName + "'"); } List<String> arguments = expressionEvaluator.getArguments(); if (arguments.contains(columnName)) { throw new IllegalStateException( "Arguments of a transform function '" + arguments + "' cannot contain the destination column '" + columnName + "'"); } argumentColumns.addAll(arguments); } if (!Collections.disjoint(transformColumns, argumentColumns)) { throw new IllegalStateException("Derived columns not supported yet. Cannot use a transform column as argument to another transform functions"); } } } }