Home > other >  Inside the operator use sparksession object
Inside the operator use sparksession object

Time:09-24

Val spark=SparkSession. Builder (). The config (conf.) getOrCreate ()

Within a operator to get a list value, need to groupbykey, so needs to be converted to RDD, using spark object, through internal broadcast radio to operator
The spark. CreateDataset (value. ToSeq) (org. Apache. Spark. SQL. Encoders. Kryo). RDD. KeyBy {x=& gt; X.g et (1)}

Then, there is no then the

Has been stuck in there, not an error or can't debugging


, for a better solution

CodePudding user response:

What you mean to create SparkSession clear,,,, correct posture is to RDD flatMapToPair method, and then conduct groupByKey
  • Related