Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- APP_NAME = "DataFrames"
- SPARK_URL = "local[*]"
- spark = SparkSession.builder.appName(APP_NAME) \
- .config('spark.ui.showConsoleProgress', 'false') \
- .getOrCreate()
- taxi = spark.read.load('/datasets/pickups_terminal_5.csv',
- format='csv', header='true', inferSchema='true')
- taxi = taxi.fillna(0)
- taxi.registerTempTable("taxi")
- print(spark.sql("SELECT COUNT(DISTINCT(CAST(date as DATE))) FROM taxi WHERE pickups > 200" ).show())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement