Commit 0012f840 authored by 张彦钊's avatar 张彦钊

add tesorflow file

parent ecba32bd
......@@ -130,6 +130,7 @@ from pyspark.sql import SQLContext
if __name__ == "__main__":
sc = SparkContext(
conf=SparkConf().setAppName("mnist_streaming").set("spark.streaming.kafka.maxRatePerPartition", 100))
ctx = SQLContext(sc)
......
from pyspark.sql import SQLContext
from pyspark.context import SparkContext
from pyspark.conf import SparkConf
def get_data():
sc = SparkContext(conf=SparkConf().setAppName("multi_task")).getOrCreate()
ctx = SQLContext(sc)
jdbcDf = ctx.read.format("jdbc").options(url="jdbc:mysql://10.66.157.22:4000/jerry_prod",
driver="com.mysql.jdbc.Driver",
dbtable="(select device_id from data_feed_click limit 8) tmp",
user="root",
password="3SYz54LS9#^9sBvC").load()
jdbcDf.show(6)
if __name__ == '__main__':
get_data()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment