Created
November 7, 2019 00:32
-
-
Save abronte/f4a70db294a8a173a47321859479171b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark_gateway import PysparkGateway | |
pg = PysparkGateway() | |
from pyspark import SparkContext, SparkConf | |
conf = conf.set('spark.io.encryption.enabled', 'true') | |
sc = SparkContext(gateway=pg.gateway, conf=conf) | |
spark = SparkSession.builder.getOrCreate() | |
df = spark.read.parquet('hdfs://data/my_table.parquet') | |
df.show() | |
cnt = df.filter('foo = "bar"').count() | |
print(cnt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment