Created
October 1, 2020 06:34
-
-
Save welly87/d8e3c8a36e83807549ba06330ad197e5 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
https://github.com/welly87/spark-load |
!git clone https://github.com/welly87/spark-load.git
!cd spark-load
!apt-get install openjdk-8-jdk-headless -qq > /dev/null
!wget -q https://downloads.apache.org/spark/spark-2.4.7/spark-2.4.7-bin-hadoop2.7.tgz
!tar xf spark-2.4.7-bin-hadoop2.7.tgz
!spark-2.4.7-bin-hadoop2.7/bin/spark-shell --driver-class-path mysql-connector-java-8.0.14.jar --jars mysql-connector-java-8.0.14.jar --packages org.apache.kudu:kudu-spark2_2.11:1.12.0 --master local[*] --conf spark.driver.bindAddress=127.0.0.1 --conf spark.driver.host=127.0.0.1 --conf spark.driver.port=7777
val sfmta_raw = spark.read.format("jdbc").option("url", "jdbc:mysql://relational.fit.cvut.cz/Student_loan?serverTimezone=UTC").option("dbtable", "person").option("user", "guest").option("password", "relational").load()
sfmta_raw.createOrReplaceTempView("person")
var df = spark.sql(s"SELECT * FROM people")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/welly87/spark-load