Github user jcmcote commented on a diff in the pull request:
https://github.com/apache/drill/pull/512#discussion_r66374867
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/impl/TestStringFunctions.java
---
@@ -114,6 +114,19 @@ public void testRegexpMatches() throws Exception {
}
@Test
+ public void testRegexpReplace() throws Exception {
+ testBuilder()
+ .sqlQuery("select regexp_replace(a, 'a|c', 'x') res1,
regexp_replace(b, 'd', 'zzz') res2 " +
+ "from (values('abc', 'bcd'), ('bcd', 'abc')) as t(a,b)")
+ .unOrdered()
+ .baselineColumns("res1", "res2")
+ .baselineValues("xbx", "bczzz")
+ .baselineValues("bxd", "abc")
+ .build()
+ .run();
+ }
+
--- End diff --
I tried replacing the c with the euro symbol â¬. But when I do I get this
error. Any idea how to specify it in the test suite. It works fine in the drill
shell but not in the test case..
(org.apache.drill.exec.work.foreman.ForemanException) Unexpected
exception during fragment initialization: Failed to encode 'abâ¬' in character
set 'ISO-8859-1'
org.apache.drill.exec.work.foreman.Foreman.run():272
java.util.concurrent.ThreadPoolExecutor.runWorker():1142
java.util.concurrent.ThreadPoolExecutor$Worker.run():617
java.lang.Thread.run():745
Caused By (org.apache.calcite.runtime.CalciteException) Failed to encode
'abâ¬' in character set 'ISO-8859-1'
sun.reflect.NativeConstructorAccessorImpl.newInstance0():-2
sun.reflect.NativeConstructorAccessorImpl.newInstance():62
sun.reflect.DelegatingConstructorAccessorImpl.newInstance():45
java.lang.reflect.Constructor.newInstance():422
org.apache.calcite.runtime.Resources$ExInstWithCause.ex():405
org.apache.calcite.runtime.Resources$ExInst.ex():514
org.apache.calcite.util.NlsString.<init>():81
org.apache.calcite.rex.RexBuilder.makeLiteral():810
org.apache.calcite.rex.RexBuilder.makeCharLiteral():985
org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertLiteral():115
org.apache.calcite.sql2rel.SqlToRelConverter.convertLiteralInValuesList():1550
org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues():1474
org.apache.calcite.sql2rel.SqlToRelConverter.convertValuesImpl():3530
org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom():1981
org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom():1852
org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl():603
org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect():583
org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive():2791
org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery():537
org.apache.drill.exec.planner.sql.SqlConverter.toRel():246
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel():616
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():195
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():164
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():94
org.apache.drill.exec.work.foreman.Foreman.runSQL():978
org.apache.drill.exec.work.foreman.Foreman.run():257
java.util.concurrent.ThreadPoolExecutor.runWorker():1142
java.util.concurrent.ThreadPoolExecutor$Worker.run():617
java.lang.Thread.run():745
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---