First, make sure that you set the property ''spark.executorEnv.MCR_CACHE_ROOT'' to something like '/tmp/matlabapp'.
Next, when using Spark version 2, the compilation command should be:
>> mcc -C -W 'Spark:flightsByCarrierDemoApp,2' flightsByCarrierDemo.m
Also, it is recommend that the code explicitly sets the SparkVersion, as shown below
>> conf = SparkConf( ...
'AppName','flightsByCarrierDemo', ...
'Master',master, ...
'SparkProperties',sparkProperties, ...
'SparkVersion', '2' ...
);
Best Answer