Github user WeichenXu123 commented on the issue:
https://github.com/apache/spark/pull/17819
@viirya Scala `with trait` is a complex mechanism and `trait` isn't
equivalent to java's `interface`. Scala compiler will precompile and generate
many other codes, so java-side code cannot directly call methods in `with
trait`. In order to test this, you can modify this file and add a line:
```
---
a/examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.java
+++
b/examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.java
@@ -59,7 +59,8 @@ public class JavaBucketizerExample {
Bucketizer bucketizer = new Bucketizer()
.setInputCol("features")
.setOutputCol("bucketedFeatures")
- .setSplits(splits);
+ .setSplits(splits)
+ .setInputCols(new String[] {"features", "features2"});
// Transform original data into its bucket index.
Dataset<Row> bucketedData = bucketizer.transform(dataFrame);
```
and you will find this Java class compile failed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]