diff --git a/src/main/java/com/snowflake/snowpark_java/Column.java b/src/main/java/com/snowflake/snowpark_java/Column.java index c50e2e1d..645255fb 100644 --- a/src/main/java/com/snowflake/snowpark_java/Column.java +++ b/src/main/java/com/snowflake/snowpark_java/Column.java @@ -236,6 +236,16 @@ public Column is_null() { return new Column(this.scalaColumn.is_null()); } + /** + * Wrapper for is_null function. + * + * @return The result column object + * @since 1.10.0 + */ + public Column isNull() { + return is_null(); + } + /** * Is not null. * diff --git a/src/main/scala/com/snowflake/snowpark/Column.scala b/src/main/scala/com/snowflake/snowpark/Column.scala index c0cec2aa..1e37ed9d 100644 --- a/src/main/scala/com/snowflake/snowpark/Column.scala +++ b/src/main/scala/com/snowflake/snowpark/Column.scala @@ -390,6 +390,14 @@ case class Column private[snowpark] (private[snowpark] val expr: Expression) ext */ def is_null: Column = withExpr(IsNull(expr)) + /** + * Wrapper for is_null function. + * + * @group op + * @since 1.10.0 + */ + def isNull: Column = is_null + /** * Is not null. * @group op diff --git a/src/test/java/com/snowflake/snowpark_test/JavaColumnSuite.java b/src/test/java/com/snowflake/snowpark_test/JavaColumnSuite.java index 4d2b1ede..14f464e5 100644 --- a/src/test/java/com/snowflake/snowpark_test/JavaColumnSuite.java +++ b/src/test/java/com/snowflake/snowpark_test/JavaColumnSuite.java @@ -117,6 +117,7 @@ public void isNull() { DataFrame data = getSession().sql("select * from values(1),(null) as T(a)"); Row[] expected = {Row.create(false, true), Row.create(true, false)}; checkAnswer(data.select(data.col("a").is_null(), data.col("a").is_not_null()), expected, false); + checkAnswer(data.select(data.col("a").isNull(), data.col("a").is_not_null()), expected, false); } @Test diff --git a/src/test/scala/com/snowflake/snowpark_test/ColumnSuite.scala b/src/test/scala/com/snowflake/snowpark_test/ColumnSuite.scala index 84f15041..df2e0e49 100644 --- a/src/test/scala/com/snowflake/snowpark_test/ColumnSuite.scala +++ b/src/test/scala/com/snowflake/snowpark_test/ColumnSuite.scala @@ -123,6 +123,7 @@ class ColumnSuite extends TestData { assert(df.where(df("A").equal_nan).collect() sameElements Array[Row](Row(Double.NaN, 3))) assert(df.where(df("A").is_null).collect() sameElements Array[Row](Row(null, 2))) + assert(df.where(df("A").isNull).collect() sameElements Array[Row](Row(null, 2))) assert( df.where(df("A").is_not_null).collect() sameElements Array[Row]( Row(1.1, 1),