Bases de Données / Databases

Site Web de l'équipe BD du LIP6 / LIP6 DB Web Site

User Tools

Site Tools


en:site:recherche:logiciels:sparqlwithspark:chain4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:site:recherche:logiciels:sparqlwithspark:chain4 [16/09/2016 23:04]
hubert
en:site:recherche:logiciels:sparqlwithspark:chain4 [16/09/2016 23:10] (current)
hubert [Chain4 query plans]
Line 6: Line 6:
 The plans produced by each method are: The plans produced by each method are:
   * SPARQL RDD:   * SPARQL RDD:
-<​code>​+ 
 +<​code ​scala>
 val d1 = triples.filter{case(s,​(p,​o))=>​ p==P1}.map{case(x1,​(p,​ x2)) => (x2, x1)} val d1 = triples.filter{case(s,​(p,​o))=>​ p==P1}.map{case(x1,​(p,​ x2)) => (x2, x1)}
 val d2 = triples.filter{case(s,​(p,​o))=>​ p==P2}.mapValues{case(p,​x3) => x3} val d2 = triples.filter{case(s,​(p,​o))=>​ p==P2}.mapValues{case(p,​x3) => x3}
Line 19: Line 20:
  
   * SPARQL DF:   * SPARQL DF:
-<​code>​+<​code ​scala>
 val t1 = df.where(s"​p=$P1"​).select("​s","​o"​).withColumnRenamed("​s",​ "​x1"​).withColumnRenamed("​o",​ "​x2"​) val t1 = df.where(s"​p=$P1"​).select("​s","​o"​).withColumnRenamed("​s",​ "​x1"​).withColumnRenamed("​o",​ "​x2"​)
 val t2 = df.where(s"​p=$P2"​).select("​s","​o"​).withColumnRenamed("​s",​ "​x2"​).withColumnRenamed("​o",​ "​x3"​) val t2 = df.where(s"​p=$P2"​).select("​s","​o"​).withColumnRenamed("​s",​ "​x2"​).withColumnRenamed("​o",​ "​x3"​)
Line 28: Line 29:
  
   * SPARQL Hybrid DF:   * SPARQL Hybrid DF:
-<​code>​+<​code ​scala>
 val subg = df.where(s"​p in ($P2, $P3, $P4)") val subg = df.where(s"​p in ($P2, $P3, $P4)")
 subg.persist subg.persist
en/site/recherche/logiciels/sparqlwithspark/chain4.1474059851.txt.gz · Last modified: 16/09/2016 23:04 by hubert