メインコンテンツ

repartition

クラス: matlab.compiler.mlspark.RDD
名前空間: matlab.compiler.mlspark

厳密に numPartitions 個のパーティションをもつ新しい RDD を返す

構文

result = repartition(obj,numPartitions)

説明

result = repartition(obj,numPartitions) は、厳密に numPartitions 個のパーティションをもつ新しい RDD result を返します。

入力引数

すべて展開する

入力 RDD。RDD オブジェクトとして指定します。

作成するパーティションの数。スカラー値として指定します。

データ型: double

出力引数

すべて展開する

numPartitions で指定されたパーティションをもつ再分割された RDD。RDD オブジェクトとして返されます。

すべて展開する

%% Connect to Spark
sparkProp = containers.Map({'spark.executor.cores'}, {'1'});
conf = matlab.compiler.mlspark.SparkConf('AppName','myApp', ...
                        'Master','local[1]','SparkProperties',sparkProp);
sc = matlab.compiler.mlspark.SparkContext(conf);

%% repartition
inputRDD = sc.parallelize({1,2,3,2,1},4);
outRDD1 = inputRDD.repartition(1); % {1,2,3,2,1}
viewRes = outRDD1.collect()

バージョン履歴

R2016b で導入