Accumulators and Broadcast Variables 这些不能从checkpoint重新恢复 如果想启动检查点的时候使用这两个变量,就需要创建这写变量的懒惰的singleton实例. 下面是一个例子: def getWordBlacklist(sparkContext): if ('wordBlacklist' not in globals()): globals()['wordBlacklist'] = sparkContext.broadcast(["a", &
### Spark SQL Running the SET -v command will show the entire list of the SQL configuration. #scala// spark is an existing SparkSession spark.sql("SET -v").show(numRows = 200, truncate = false)#java // spark is an existing SparkSession spark.sql