Skip to content

Instantly share code, notes, and snippets.

@wusuopubupt
Created June 27, 2017 06:50
Show Gist options
  • Save wusuopubupt/5541c9bed965f5f16eccf7953c6ebd7b to your computer and use it in GitHub Desktop.
Save wusuopubupt/5541c9bed965f5f16eccf7953c6ebd7b to your computer and use it in GitHub Desktop.
get sql context by dataframe
from pyspark.sql import SQLContext
sqlContext = SQLContext.getOrCreate(t1.rdd.context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment