Created
July 2, 2019 18:10
-
-
Save hsuyuming/37b5d1c84fa7d60247f04a2370a37b91 to your computer and use it in GitHub Desktop.
This file contains 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
import net.snowflake.spark.snowflake.Utils.SNOWFLAKE_SOURCE_NAME | |
import org.apache.spark.sql.SparkSession | |
val sparkSession = SparkSession.builder.master("local[*]").appName("spark session example").getOrCreate() | |
var sfOptions = Map ("sfUrl"->"<hostname>","sfAccount"->"<acount>","sfUser"->"<username>","sfPassword"->"<password>","sfDatabase"->"<database>","sfSchema"->"<schema>") | |
df = sparkSession.read.format(SNOWFLAKE_SOURCE_NAME).options(sfOptions).option("query","SELECT * FROM SPARK_PERMISSION_TEST.PUBLI;").load() | |
df.show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment