在pycharm中编写如下代码:
from pyspark import SparkConf,SparkContext
def MyPartitioner(key): #自定义分区函数
print('MyPartitioner is running')
print('the key is %d'%key)
return key%
在pycharm中编写如下代码:
from pyspark import SparkConf,SparkContext
def MyPartitioner(key): #自定义分区函数
print('MyPartitioner is running')
print('the key is %d'%key)
return key%