Skip to content

eclairjs node treats spark objects as immutable #93

Description

@pberkland

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions