Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/16553#discussion_r96137355
--- Diff:
sql/core/src/test/java/test/org/apache/spark/sql/JavaUDFSuite.java ---
@@ -108,4 +109,24 @@ public void udf3Test() {
result = spark.sql("SELECT stringLengthTest('test', 'test2')").head();
Assert.assertEquals(9, result.getInt(0));
}
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void udf4Test() {
+ spark.udf().register("inc", new UDF1<Long, Long>() {
+ @Override
+ public Long call(Long i) {
+ return i + 1;
+ }
+ }, DataTypes.LongType);
+
+ spark.range(10).toDF("x").createOrReplaceTempView("tmp");
+ List<Row> results = spark.sql("SELECT inc(x) FROM tmp GROUP BY
inc(x)").collectAsList();
--- End diff --
This test is not so obvious what it goes to test for. Can we add few
comments showing that?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]