Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AdTech Scala Meetup 9 Spark SQL Thrift JDBC Server

AdTech Scala Meetup 9 Spark SQL Thrift JDBC Server

CyberAgent アドテクスタジオで開催されているScala Meetupで行ったLTの資料です。Thrift JDBC Server についての話。

Shuya Tsukamoto

March 28, 2016
Tweet

Other Decks in Technology

Transcript

  1. 4QBSL42-FYBNQMF val sqlContext = new org.apache.spark.sql.SQLContext(sc) import sqlContext.implicits._ case class

    Person(name: String, age: Int) val people = sc.textFile("examples/src/main/resources/people.txt") .map(_.split(",")).map(p => Person(p(0), p(1).trim.toInt)).toDF() people.registerTempTable("people") val teenagers = sqlContext .sql("SELECT name, age FROM people WHERE age >= 13 AND age <= 19") teenagers.map( t => "Name: " + t.getAs[String]("name") ).collect().foreach(println) 
  2. +%#$TFSWFSFYBNQMF  4QBSL%-  1SFCVJMUGPS$%) 
 IUUQTTQBSLBQBDIFPSHEPXOMPBETIUNM  UBSYW[GTQBSLYYYUH[ 

    DETQBSLYYY  DPOGIJWFTJUFYNMΛ࡞੒
 <configuration> <property> <name>hive.metastore.warehouse.dir</name> <value>/var/spark/hive/warehouse</value> </property> </configuration> TVEPNLEJSQ
 TVEPDIPXO 
  3. +%#$TFSWFSFYBNQMF w ޙ͸ެࣜEPDʹै͍ͭͭɾɾɾ  TCJOTUBSUUISJGUTFSWFSTI  CJOCFFMJOF  DPOOFDUKECDIJWFMPDBMIPTU
 6TFS/BNF͸ద౰ɺ1BTT͸ۭ

      DSFBUFจ create table users(name string, age int) row format delimited fields terminated by ',' lines terminated by '\n';