官术网_书友最值得收藏!

.collect() action

We have also cautioned you about using this action; collect() returns all of the elements from the workers to the driver. Thus, look at the following code:

# Return all airports elements
# filtered by WA state
airports.filter(lambda c: c[1] == "WA").collect()

This will generate the following output:

# Output
[[u'Bellingham', u'WA', u'USA', u'BLI'], [u'Moses Lake', u'WA', u'USA', u'MWH'], [u'Pasco', u'WA', u'USA', u'PSC'], [u'Pullman', u'WA', u'USA', u'PUW'], [u'Seattle', u'WA', u'USA', u'SEA'], [u'Spokane', u'WA', u'USA', u'GEG'], [u'Walla Walla', u'WA', u'USA', u'ALW'], [u'Wenatchee', u'WA', u'USA', u'EAT'], [u'Yakima', u'WA', u'USA', u'YKM']]
主站蜘蛛池模板: 沙洋县| 乌兰察布市| 顺平县| 漳浦县| 吉安县| 阿鲁科尔沁旗| 白山市| 大埔区| 浙江省| 浪卡子县| 湄潭县| 丰县| 绥江县| 泰安市| 江山市| 沾益县| 墨玉县| 怀化市| 正镶白旗| 弥渡县| 七台河市| 色达县| 湟中县| 文登市| 邓州市| 秭归县| 广河县| 通道| 岳普湖县| 游戏| 磴口县| 克东县| 樟树市| 临泉县| 凤山县| 资中县| 瑞金市| 安庆市| 长春市| 鄂托克前旗| 永顺县|