Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rong Rong committed Jan 4, 2024
1 parent 770dfd9 commit 7a9c87c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static String substring(String input, int beginIndex, int length) {
* @param seperator
* @return The two input strings joined by the seperator
*/
@ScalarFunction(names = "concat_ws")
@ScalarFunction(names = {"concatWS", "concat_ws"})
public static String concatws(String seperator, String input1, String input2) {
return concat(input1, input2, seperator);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;


public class InbuiltFunctionEvaluatorTest {
Expand Down Expand Up @@ -158,21 +157,6 @@ public void testNullReturnedByInbuiltFunctionEvaluatorThatCannotTakeNull() {
}
}

@Test
public void testPlaceholderFunctionShouldNotBeRegistered()
throws Exception {
GenericRow row = new GenericRow();
row.putValue("testColumn", "testValue");
String expression = "text_match(testColumn, 'pattern')";
try {
InbuiltFunctionEvaluator evaluator = new InbuiltFunctionEvaluator(expression);
evaluator.evaluate(row);
fail();
} catch (Throwable t) {
assertTrue(t.getMessage().contains("text_match"));
}
}

public static class MyFunc {
String _baseString = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testPostAggregationFunction() {
assertEquals(function.invoke(new Object[]{"1234567890"}), "0987654321");

// ST_AsText
function = new PostAggregationFunction("ST_AsText", new ColumnDataType[]{ColumnDataType.BYTES});
function = new PostAggregationFunction("ST_As_Text", new ColumnDataType[]{ColumnDataType.BYTES});
assertEquals(function.getResultType(), ColumnDataType.STRING);
assertEquals(function.invoke(
new Object[]{GeometrySerializer.serialize(GeometryUtils.GEOMETRY_FACTORY.createPoint(new Coordinate(10, 20)))}),
Expand Down

0 comments on commit 7a9c87c

Please sign in to comment.