Skip to content

Commit

Permalink
modified comments and test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-sjayabalan committed Aug 20, 2024
1 parent bdf0ba9 commit 3179e0b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 33 deletions.
12 changes: 0 additions & 12 deletions src/main/java/com/snowflake/snowpark_java/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -3925,18 +3925,6 @@ public static Column isnull(Column c) {
return new Column(com.snowflake.snowpark.functions.isnull(c.toScalaColumn()));
}

/**
* Wrapper for Snowflake built-in conv function. Convert number with from and to base.
*
* @since 1.14.0
* @param c Column to be converted.
* @param fromBase Column from base format.
* @param toBase Column to base format.
* @return Column object.
*/
public static Column conv(Column c, Integer fromBase, Integer toBase) {
return new Column(com.snowflake.snowpark.functions.conv(c.toScalaColumn(), fromBase, toBase));
}
/**
* Returns the current Unix timestamp (in seconds) as a long. Extracts a specified date or time
* portion from a date, time, or timestamp. All calls of `unix_timestamp` within the same query
Expand Down
11 changes: 0 additions & 11 deletions src/main/scala/com/snowflake/snowpark/functions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3176,17 +3176,6 @@ object functions {
*/
def isnull(c: Column): Column = is_null(c)

/**
* Wrapper for Snowflake built-in conv function. Convert number with from and to base.
* @since 1.14.0
* @param c Column to be converted.
* @param fromBase Column from base format.
* @param toBase Column to base format.
* @return Column object.
*/
def conv(c: Column, fromBase: Int, toBase: Int): Column =
callBuiltin("conv", c, fromBase, toBase)

/**
* Returns the current Unix timestamp (in seconds) as a long.
* Extracts a specified date or time portion from a date, time, or timestamp.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2778,11 +2778,6 @@ public void isnull() {
checkAnswer(df.select(Functions.isnull(df.col("a"))), expected, false);
}

public void conv() {
DataFrame df = getSession().sql("select * from values('010101') as t(a)");
checkAnswer(df.select(Functions.conv(df.col("a"), 2, 16)), new Row[] {Row.create("15")}, false);
}

public void unix_timestamp() {
DataFrame df =
getSession().sql("select * from values('2024-04-08T23:39:20.123-07:00') as t(a)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2185,12 +2185,9 @@ trait FunctionSuite extends TestData {

test("isnull") {
val data = Seq("1", null).toDF("a")
checkAnswer(data.select(isnull(col("a"))), Seq(Row(true, false)), sort = false)
}
test("conv") {
val data = Seq("010101").toDF("a")
checkAnswer(data.select(conv(col("a"), 2, 16)), Seq(Row("15")), sort = false)
checkAnswer(data.select(isnull(col("a"))), Seq(Row(true), Row(false)), sort = false)
}

test("unix_timestamp") {
val data = Seq("2024-04-08T23:39:20.123-07:00").toDF("a")
checkAnswer(data.select(unix_timestamp(col("a"))), Seq(Row("1712619560123")), sort = false)
Expand Down

0 comments on commit 3179e0b

Please sign in to comment.