Commit 85e86bbb238a1189d53c02d7bbf352e6405f2175

Authored by Joanne ago
1 parent 3f5548ee23
Exists in master

include main

Showing 1 changed file with 11 additions and 10 deletions Side-by-side Diff

app/com/piki_ds/ver1/InsertCidList.scala View file @ 85e86bb
... ... @@ -12,7 +12,6 @@
12 12  
13 13 var sc: SparkContext = SparkContext.getOrCreate()
14 14 var sqlContext: SQLContext = SQLContext.getOrCreate(sc)
15   -
16 15 val modelName: Map[String, Seq[String]] = Map(
17 16 "uniform" ->
18 17 Seq("quality"),
19 18  
... ... @@ -33,16 +32,18 @@
33 32 )
34 33 )
35 34  
36   - modelName("single").foreach(model=> {
37   - val doi = "20160508"
38   - val getMax30 = sc.objectFile[(Int, String)](s"/user/joanne/clols/$doi/$model")
39   - getMax30.groupBy(x=>x._1%1000).foreach(x=>{
40   - val tableName = s"uuid-cidlist_$model"
41   - val insertArray = x._2.map(a=>(a._1.toString,a._2)).toArray
42   - val test = new HbaseInserter(tableName)
43   - test.insert(insertArray)
  35 + def main(args: Array[String]) {
  36 + modelName("single").foreach(model=> {
  37 + val doi = "20160508"
  38 + val getMax30 = sc.objectFile[(Int, String)](s"/user/joanne/clols/$doi/$model")
  39 + getMax30.groupBy(x=>x._1%1000).foreach(x=>{
  40 + val tableName = s"uuid-cidlist_$model"
  41 + val insertArray = x._2.map(a=>(a._1.toString,a._2)).toArray
  42 + val test = new HbaseInserter(tableName)
  43 + test.insert(insertArray)
  44 + })
44 45 })
45   - })
  46 + }
46 47  
47 48 }