You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org> on 2023/03/19 04:51:41 UTC

[GitHub] [druid] github-code-scanning[bot] commented on a diff in pull request #13947: expression transform improvements and fixes

github-code-scanning[bot] commented on code in PR #13947:
URL: https://github.com/apache/druid/pull/13947#discussion_r1141257326


##########
processing/src/test/java/org/apache/druid/query/expression/RegexpExtractExprMacroTest.java:
##########
@@ -37,55 +37,55 @@
   public void testErrorZeroArguments()
   {
     expectException(IllegalArgumentException.class, "Function[regexp_extract] requires 2 or 3 arguments");
-    eval("regexp_extract()", InputBindings.withMap(ImmutableMap.of()));
+    eval("regexp_extract()", InputBindings.forMap(ImmutableMap.of()));
   }
 
   @Test
   public void testErrorFourArguments()
   {
     expectException(IllegalArgumentException.class, "Function[regexp_extract] requires 2 or 3 arguments");
-    eval("regexp_extract('a', 'b', 'c', 'd')", InputBindings.withMap(ImmutableMap.of()));
+    eval("regexp_extract('a', 'b', 'c', 'd')", InputBindings.forMap(ImmutableMap.of()));
   }
 
   @Test
   public void testMatch()
   {
-    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)')", InputBindings.withMap(ImmutableMap.of("a", "foo")));
+    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)')", InputBindings.forMap(ImmutableMap.of("a", "foo")));
     Assert.assertEquals("foo", result.value());
   }
 
   @Test
   public void testMatchGroup0()
   {
-    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)', 0)", InputBindings.withMap(ImmutableMap.of("a", "foo")));
+    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)', 0)", InputBindings.forMap(ImmutableMap.of("a", "foo")));
     Assert.assertEquals("foo", result.value());
   }
 
   @Test
   public void testMatchGroup1()
   {
-    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)', 1)", InputBindings.withMap(ImmutableMap.of("a", "foo")));
+    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)', 1)", InputBindings.forMap(ImmutableMap.of("a", "foo")));
     Assert.assertEquals("oo", result.value());
   }
 
   @Test
   public void testMatchGroup2()
   {
     expectedException.expectMessage("No group 2");
-    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)', 2)", InputBindings.withMap(ImmutableMap.of("a", "foo")));
+    final ExprEval<?> result = eval("regexp_extract(a, 'f(.o)', 2)", InputBindings.forMap(ImmutableMap.of("a", "foo")));

Review Comment:
   ## Unread local variable
   
   Variable 'ExprEval<?> result' is never read.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/4409)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org