Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gmahadevan committed Aug 7, 2024
1 parent 92b52c8 commit 0d1df77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/snowflake/snowpark_java/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.snowflake.snowpark.internal.JavaUtils;
import com.snowflake.snowpark_java.types.DataType;
import com.snowflake.snowpark_java.udf.*;
import net.snowflake.client.jdbc.internal.org.checkerframework.checker.units.qual.C;

import java.util.List;
import java.util.function.Supplier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2820,10 +2820,8 @@ public void last() {
DataFrame df = getSession().sql("select * from values (5, 'a', 10), (5, 'b', 20),\n" +
" (3, 'd', 15), (3, 'e', 40) as T(grade,name,score)");

df.select(Functions.last(df.col("name")).over(Window.partitionBy(df.col("grade")).orderBy(df.col("score").desc())).as("last_value")).show();
// Row[] expected = {Row.create("a"), Row.create("a"), Row.create("d"), Row.create("d")};

// checkAnswer(df.select(Functions.last(df.col("name")).over(Window.partitionBy(df.col("grade")).orderBy(df.col("score").desc()))), expected, false);
Row[] expected = {Row.create("a"), Row.create("a"), Row.create("d"), Row.create("d")};
checkAnswer(df.select(Functions.last(df.col("name")).over(Window.partitionBy(df.col("grade")).orderBy(df.col("score").desc()))), expected, false);
}

}

0 comments on commit 0d1df77

Please sign in to comment.