Created
July 25, 2017 03:32
-
-
Save WanderingStar/aa22e166ae19579d2fa2d3767e8598f5 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
df1 = spark.createDataFrame(rdd1).toDF("id", "val") | |
df1.createOrReplaceTempView("table1") | |
df2 = spark.createDataFrame(rdd2).toDF("id", "val") | |
df2.createOrReplaceTempView("table2") | |
def callable_ssql_timeit(): | |
query="SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id" | |
spark.sql(query) | |
print(timeit.timeit(callable_ssql_timeit, number=100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment