-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
Description
A side effect of the eclairjs node code generation is a number of spark objects are treated as immutable, thereby making the nodejs spark api not work the same as the normal spark api.
for instance, the following code will not work
var paramMap2 = new spark.ml.param.ParamMap();
paramMap2.put(lr.probabilityCol().w("myProbability")); // Change output column name
var paramMapCombined = paramMap.$plus$plus(paramMap2);
because the $plus$plus will be executed before the paramMap2.put is executed.
This can be worked around by instead doing
var paramMap3 = paramMap2.put(lr.probabilityCol().w("myProbability"));
var paramMapCombined = paramMap.$plus$plus(paramMap3);
but it is not obvious to the eclairjs user when that should be done, because with the normal spark programing (including eclairjs nashorn) it is not necessary.