diff --git a/pom.xml b/pom.xml
index 4929993c5..a17664541 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,7 +77,7 @@
1.6
2.16.1
1.4
- 3.0
+ 3.3
2.6
3.5
3.6.1
diff --git a/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java b/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java
index 28baad940..d3f3cac09 100644
--- a/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java
+++ b/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java
@@ -35,6 +35,7 @@
import org.apache.commons.jexl3.JexlException;
import org.apache.commons.jexl3.JexlInfo;
import org.apache.commons.jexl3.JexlScript;
+import org.apache.commons.jexl3.introspection.JexlPermissions;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.logging.Log;
@@ -87,6 +88,7 @@ public static EL compile(ELRegistration registration, String expression) throws
.cache(1024)
.strict(true)
.logger(new NullLogger())
+ .permissions(JexlPermissions.UNRESTRICTED)
.create();
try {
diff --git a/wrangler-core/src/main/java/io/cdap/wrangler/metrics/JexlCategoryMetricUtils.java b/wrangler-core/src/main/java/io/cdap/wrangler/metrics/JexlCategoryMetricUtils.java
index ffc0225b2..a762ad998 100644
--- a/wrangler-core/src/main/java/io/cdap/wrangler/metrics/JexlCategoryMetricUtils.java
+++ b/wrangler-core/src/main/java/io/cdap/wrangler/metrics/JexlCategoryMetricUtils.java
@@ -20,8 +20,7 @@
import io.cdap.wrangler.expression.EL;
import org.apache.commons.jexl3.parser.ParserTokenManager;
import org.apache.commons.jexl3.parser.SimpleCharStream;
-
-import java.io.ByteArrayInputStream;
+import org.apache.commons.jexl3.parser.StringProvider;
import java.util.Map;
import javax.annotation.Nullable;
@@ -57,7 +56,7 @@ public static EntityCountMetric getJexlCategoryMetric(String jexlScript) {
private static String parseJexlCategory(String script) {
ParserTokenManager manager = new ParserTokenManager(
- new SimpleCharStream(new ByteArrayInputStream(script.getBytes())));
+ new SimpleCharStream(new StringProvider(script)));
return manager.getNextToken().toString();
}
}
diff --git a/wrangler-core/src/test/java/io/cdap/directives/row/RowConditionFilterTest.java b/wrangler-core/src/test/java/io/cdap/directives/row/RowConditionFilterTest.java
index 18e3c108f..12e14cc45 100644
--- a/wrangler-core/src/test/java/io/cdap/directives/row/RowConditionFilterTest.java
+++ b/wrangler-core/src/test/java/io/cdap/directives/row/RowConditionFilterTest.java
@@ -19,6 +19,8 @@
import io.cdap.wrangler.TestingRig;
import io.cdap.wrangler.api.RecipeException;
import io.cdap.wrangler.api.Row;
+import io.cdap.wrangler.expression.EL;
+import io.cdap.wrangler.expression.ELContext;
import org.junit.Assert;
import org.junit.Test;
@@ -30,17 +32,17 @@
*/
public class RowConditionFilterTest {
- @Test(expected = RecipeException.class)
- public void testRHSLHSTypeDisconnect() throws Exception {
+ @Test
+ public void testRHSLHSTypeCoercion() throws Exception {
String[] directives = new String[]{
"parse-as-csv body ,",
"drop body",
"set columns PassengerId,Survived,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked",
- "filter-row-if-true Fare < 10" // RHS is double, but it's not converted. Check next test case.
+ "filter-row-if-true Fare < 10" // JEXL 3.3 supports coercion between string and numeric types directly
};
List rows = Arrays.asList(
- new Row("body", "1,0,3,\"Braund, Mr. Owen Harris\",male,22,1,0,A/5 21171,7.25,,S"),
+ new Row("body", "1,0,3,\"Braund, Mr. Owen Harris\",male,22,1,0,A/5 21171,7,,S"),
new Row("body", "2,1,1,\"Cumings, Mrs. John Bradley (Florence Briggs Thayer)\",female," +
"38,1,0,PC 17599,71.2833,C85,C")
);