我有一小段代码:
sales = hive_context.table("inv_opt_test.store_sales")
sales1 = sales.rdd.map(lambda x : (str(x[0])+"-"+str(x[1]),x[3:]))
BaseStockLevel = sales1.groupByKey().map(lambda x: BigFunction(x)).cache()
在从Hive表中读取之后,我创建了密钥.map(lambda x : (str(x[0])+"-"+str(x[1]),x[3:]))
,然后创建了具有相同密钥sales1.groupByKey()
的数据组。所有上述阶段都在多个执行程序中运行,但在地图阶段使用自定义函数.map(lambda x: BigFunction(x))
,它只在一个执行程序中运行。
我认为情况不像Why is my Spark App running in only 1 executor?那样。可能是这种行为的原因还是我错过了任何设置?