Skip to content

Dataset Lamda functions need to be aware of encoder type #307

@pberkland

Description

@pberkland

The following will cause a class cast exception (can't cast double to integer)
var ds = sparkSession.createDataset([1,2,3], Encoders.INT());
ds =ds.map( function(value) {
return value + 1;
}, Encoders.INT());
This is because the return value from js defaults to double. The lambda function should be aware of the encoder type, and do the appropriate conversion.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions