Skip to content

Commit 5e6fe79

Browse files
authored
Update updataData.py
1 parent ad50918 commit 5e6fe79

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

updataData.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
from pyspark import SparkContext, SparkConf
2+
from pyspark.sql import SQLContext
3+
from pyspark.sql.functions import lit
4+
5+
conf = SparkConf().setAppName("updateSchools")
6+
sc = SparkContext(conf=conf)
7+
sc.setLogLevel("INFO")
8+
spark = SQLContext(sc)
9+
10+
reader = spark.read.format("org.elasticsearch.spark.sql").option("es.read.metadata", "true").option("es.nodes.wan.only","true").option("es.port","9200").option("es.net.ssl","false").option("es.nodes", "http://localhost")
11+
112
df = reader.load("school")
213
df.show()
314

0 commit comments

Comments
 (0)