Skip to content

Commit ec1a655

Browse files
committed
[SPARK-30193]Wrong 2nd argument type. Found: 'org.apache.spark.sql.Column', required: 'scala.collection.Seq<org.apache.spark.sql.Column>'
1 parent 538b8d1 commit ec1a655

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/src/main/java/org/apache/spark/examples/ml/JavaTokenizerExample.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
import org.apache.spark.sql.Dataset;
3131
import org.apache.spark.sql.Row;
3232
import org.apache.spark.sql.RowFactory;
33+
import org.apache.spark.sql.*;
3334
import org.apache.spark.sql.types.DataTypes;
3435
import org.apache.spark.sql.types.Metadata;
3536
import org.apache.spark.sql.types.StructField;
3637
import org.apache.spark.sql.types.StructType;
3738

38-
// col("...") is preferable to df.col("...")
39-
import static org.apache.spark.sql.functions.callUDF;
4039
import static org.apache.spark.sql.functions.col;
4140
// $example off$
4241

@@ -73,12 +72,12 @@ public static void main(String[] args) {
7372

7473
Dataset<Row> tokenized = tokenizer.transform(sentenceDataFrame);
7574
tokenized.select("sentence", "words")
76-
.withColumn("tokens", callUDF("countTokens", col("words")))
75+
.withColumn("tokens", functions.callUDF("countTokens", col("words")))
7776
.show(false);
7877

7978
Dataset<Row> regexTokenized = regexTokenizer.transform(sentenceDataFrame);
8079
regexTokenized.select("sentence", "words")
81-
.withColumn("tokens", callUDF("countTokens", col("words")))
80+
.withColumn("tokens", functions.callUDF("countTokens", col("words")))
8281
.show(false);
8382
// $example off$
8483

sql/hive/src/test/java/org/apache/spark/sql/hive/JavaDataFrameSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void testUDAF() {
8585
udaf.distinct(col("value")),
8686
udaf.apply(col("value")),
8787
registeredUDAF.apply(col("value")),
88-
callUDF("mydoublesum", col("value")));
88+
functions.callUDF("mydoublesum", col("value")));
8989

9090
List<Row> expectedResult = new ArrayList<>();
9191
expectedResult.add(RowFactory.create(4950.0, 9900.0, 9900.0, 9900.0));

0 commit comments

Comments
 (0)