随笔分类 - spark
python生产和消费kafka数据
摘要:安装kafka-python pip install kafka-python 生产者 from kafka import KafkaProducer # 有时候导入包会报错,使用pip uninstall kafka-python,卸载后重装可以解决 import json # 创建produce
阅读全文
spark streaming updatestatebykey scala
摘要:import org.apache.spark.streaming._ import org.apache.spark.SparkConf import org.apache.spark.sql.SparkSession import org.apache.spark.streaming.dstre
阅读全文
first spark streaming
摘要:import org.apache.spark.streaming._ import org.apache.spark.SparkConf import org.apache.spark.sql.SparkSession val conf = new SparkConf().setAppName("
阅读全文