From cb7e041bb628366222a3bf99d7ac590f5fbb361e Mon Sep 17 00:00:00 2001 From: Shyamala Jayabalan Date: Thu, 15 Aug 2024 10:05:50 -0400 Subject: [PATCH] Reformatted --- src/main/java/com/snowflake/snowpark_java/Functions.java | 5 ++--- src/main/scala/com/snowflake/snowpark/functions.scala | 3 +-- .../java/com/snowflake/snowpark_test/JavaFunctionSuite.java | 4 ++-- .../scala/com/snowflake/snowpark_test/FunctionSuite.scala | 4 +--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/snowflake/snowpark_java/Functions.java b/src/main/java/com/snowflake/snowpark_java/Functions.java index 41c38135..4b3bdb1d 100644 --- a/src/main/java/com/snowflake/snowpark_java/Functions.java +++ b/src/main/java/com/snowflake/snowpark_java/Functions.java @@ -3882,7 +3882,7 @@ public static Column listagg(Column col) { } /** - + * * Signature - snowflake.snowpark.functions.regexp_extract (value: Union[Column, str], regexp: * Union[Column, str], idx: int) Column Extract a specific group matched by a regex, from the * specified string column. If the regex did not match, or the specified group did not match, an @@ -3995,7 +3995,7 @@ public static Column collect_list(Column col) { return new Column(com.snowflake.snowpark.functions.collect_list(col.toScalaColumn())); } - * Returns a Column expression with values sorted in descending order. + /* Returns a Column expression with values sorted in descending order. * *

Example: order column values in descending * @@ -4166,7 +4166,6 @@ public static Column last(Column col) { return new Column(functions.last(col.toScalaColumn())); } - /** * Calls a user-defined function (UDF) by name. * diff --git a/src/main/scala/com/snowflake/snowpark/functions.scala b/src/main/scala/com/snowflake/snowpark/functions.scala index a28be119..588d8290 100644 --- a/src/main/scala/com/snowflake/snowpark/functions.scala +++ b/src/main/scala/com/snowflake/snowpark/functions.scala @@ -3328,7 +3328,7 @@ object functions { */ def collect_list(s: String): Column = array_agg(col(s)) - * Returns a Column expression with values sorted in descending order. + /* Returns a Column expression with values sorted in descending order. * Example: * {{{ * val df = session.createDataFrame(Seq(1, 2, 3)).toDF("id") @@ -3498,7 +3498,6 @@ object functions { def last(c: Column): Column = builtin("LAST_VALUE")(c) - /** * Invokes a built-in snowflake function with the specified name and arguments. * Arguments can be of two types diff --git a/src/test/java/com/snowflake/snowpark_test/JavaFunctionSuite.java b/src/test/java/com/snowflake/snowpark_test/JavaFunctionSuite.java index 954cb278..f70ccdea 100644 --- a/src/test/java/com/snowflake/snowpark_test/JavaFunctionSuite.java +++ b/src/test/java/com/snowflake/snowpark_test/JavaFunctionSuite.java @@ -2766,7 +2766,6 @@ public void any_value() { } @Test - public void regexp_extract() { DataFrame df = getSession().sql("select * from values('A MAN A PLAN A CANAL') as T(a)"); Row[] expected = {Row.create("MAN")}; @@ -2813,6 +2812,8 @@ public void substring_index() { checkAnswer( df.select(Functions.substring_index(df.col("a"), "was", 1)), new Row[] {Row.create(7)}, + false); + } public void test_asc() { DataFrame df = getSession().sql("select * from values(3),(1),(2) as t(a)"); @@ -2874,7 +2875,6 @@ public void last() { Functions.last(df.col("name")) .over(Window.partitionBy(df.col("grade")).orderBy(df.col("score").desc()))), expected, - false); } } diff --git a/src/test/scala/com/snowflake/snowpark_test/FunctionSuite.scala b/src/test/scala/com/snowflake/snowpark_test/FunctionSuite.scala index 22f474ea..1420bb10 100644 --- a/src/test/scala/com/snowflake/snowpark_test/FunctionSuite.scala +++ b/src/test/scala/com/snowflake/snowpark_test/FunctionSuite.scala @@ -2195,7 +2195,6 @@ trait FunctionSuite extends TestData { expected, sort = false) - expected = Seq(Row(null)) checkAnswer( data.select(regexp_extract(col("a"), "A\\W+(\\w+)", 1, 4, 1)), @@ -2221,7 +2220,7 @@ trait FunctionSuite extends TestData { val df = Seq("It was the best of times, it was the worst of times").toDF("a") checkAnswer(df.select(substring_index(col("a"), "was", 1)), Seq(Row(7)), sort = false) } - + test("desc column order") { val input = Seq(1, 2, 3).toDF("data") val expected = Seq(3, 2, 1).toDF("data") @@ -2289,7 +2288,6 @@ trait FunctionSuite extends TestData { sort = false) } - } class EagerFunctionSuite extends FunctionSuite with EagerSession