OptimizedDataSet cannot be cast to BasicDataset?

I have a client scope script function which invoke with RPC a gateway calculation which return a BasicDataset.

It was working fine in 7.9.10. Now I have the following error :

java.lang.ClassCastException: com.inductiveautomation.ignition.client.gateway_interface.OptimizedDataSet cannot be cast to com.inductiveautomation.ignition.common.BasicDataset

I’ve upgraded to 7.9.11.
The dataset has about 50000 rows.
the error seems to be caused by the size of the serialized dataset ?

OptimizedDataset doesn’t inherit from BasicDataset. Use the alternate constructor for BasicDataset that just accepts any other Dataset implementor if you specifically need a BasicDataset.

(I confirm with 5000 rows, I don’t have the problem).

Thanks a lot @PGriffith, I change the RPC return from BasicDataset to Dataset and the problem is solved :+1:

1 Like

I am having the same issue but don’t exactly follow what I need to change to fix this. When I tried to change what was returned to a Dataset, it would not accept that because Dataset is just an interface. @mazeyrat can you please go into a little more detail about what you changed? Thanks.