Package

com.datastax.bdp.graph.spark

graphframe

Permalink

package graphframe

The root package of DSE GraphFrame support. Offers handy implicit conversions that add DSE-specific methods to SparkSession and GraphFrame.

Call dseGraph method on the SparkSession object to create a GraphFrame exposing DSE Graph as Spark GraphFrame.

Call GraphFrameFunctions saveToDse function on any GraphFrame to save updated graph back to DSE.

Example:

 import com.datastax.bdp.graph.spark.graphframe._

val graphName = "test"
// Read graph and print vertices labels:
 val graph = spark.dseGraph(graphName)
 graph.V().select("label").distinct.show
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. graphframe
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class DGFCleaner extends AnyRef

    Permalink
  2. class DGFCleanerInterceptor extends SparkVertexProgramInterceptor[CleanGraphVertexProgram]

    Permalink
  3. class DGFCleanupStats extends AnyRef

    Permalink
  4. class DseGraphFrame extends Serializable

    Permalink

    Provides DSEGraph-specific methods on GraphFrame It support graphName is needed for some traversal steps and to write data back It can be lost during DseGraphFrame->GraphFrame->DseGraphFrame implicit conversions set graphName tot he target graph if needed.

  5. class DseGraphFrameBuilder extends AnyRef

    Permalink

    Helper class to create GraphFrame from C* backend.

    Helper class to create GraphFrame from C* backend. The GraphFrame caches dataframes on creation. It is recommended to call withVertex method to create subgraph prior graph frame creation to reduce memory footprint

    Usage: val dataFrame = DseGraphFrameBuilder("graph", spark).dseGraph()

  6. class DseGraphTraversal[E] extends DefaultGraphTraversal[Row, E]

    Permalink

    wrap vertex data frame to implement TinkerPop functions

  7. type DseGraphTraversalInterceptor = PartialFunction[DseGraphTraversal[_], DataFrame]

    Permalink

    should be used to implement optimization for DseGraphTraversal

    should be used to implement optimization for DseGraphTraversal

    if isDefinedAt(traversal: DseGraphTraversal[_]) methods returns true apply() methods return result DataFrame. It will be used as result instead of standard DseGraphTraversal enumerates internal list of interceptors. TODO: provide user faced extension mechanism

  8. class EdgeBuilder extends GraphComponentBuilder with Serializable

    Permalink
  9. abstract class GraphComponentBuilder extends Serializable

    Permalink
  10. class SparkSessionFunctions extends Serializable

    Permalink

    Provides DSE-specific methods on SparkSession

  11. class VertexBuilder extends GraphComponentBuilder with Serializable

    Permalink

    Internal class to build table for one class of vertex

Value Members

  1. object DGFCleaner

    Permalink
  2. object DseGraphFrame extends Serializable

    Permalink
  3. object DseGraphFrameBuilder

    Permalink

    Usage: val dataFrame = DseGraphFrameBuilder("graph", spark).dataFrame()

  4. object Order

    Permalink

    spark-shell show error: "ambiguous reference to overloaded definition" for two functions: GraphTraversal.by(Order) GraphTraversal.by(Comparable) * scala> g.V().values("name").order().by(Order.decr) console>:43: error: ambiguous reference to overloaded definition, both method by in trait GraphTraversal of type (x$1: org.apache.tinkerpop.gremlin.process.traversal.Order)org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal[org.apache.spark.sql.Row,E2] and method by in trait GraphTraversal of type (x$1: java.util.Comparator[E2])org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal[org.apache.spark.sql.Row,E2] match argument types (org.apache.tinkerpop.gremlin.process.traversal.Order)

    spark-shell show error: "ambiguous reference to overloaded definition" for two functions: GraphTraversal.by(Order) GraphTraversal.by(Comparable) * scala> g.V().values("name").order().by(Order.decr) console>:43: error: ambiguous reference to overloaded definition, both method by in trait GraphTraversal of type (x$1: org.apache.tinkerpop.gremlin.process.traversal.Order)org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal[org.apache.spark.sql.Row,E2] and method by in trait GraphTraversal of type (x$1: java.util.Comparator[E2])org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal[org.apache.spark.sql.Row,E2] match argument types (org.apache.tinkerpop.gremlin.process.traversal.Order)

    To workaround this problem you should directly cast Order to super class: Comparable scala> g.V().values("name").order().by(Order.decr.asInstanceOf[Order])

    that is inconvenient for user. This class is replicate the Order interface but returns Comparable instread of Order. It is used in spark-shell imports

  5. object VertexLabelDropInterceptor extends DseGraphTraversalInterceptor

    Permalink
  6. implicit def backToDseVertexFrame[E](gt: GraphTraversal[Row, E]): DseGraphTraversal[E]

    Permalink

  7. implicit def fromDseGraphFrame(gf: DseGraphFrame): GraphFrame

    Permalink
  8. implicit def fromVertexFrame[E](gt: GraphTraversal[Row, E]): DataFrame

    Permalink

    add all DataFrame functions to DseGraphTraversal

  9. package optimizer

    Permalink
  10. implicit def toDseGraphFrame(gf: GraphFrame): DseGraphFrame

    Permalink
  11. implicit def toSparkSessionFunctions(spark: SparkSession): SparkSessionFunctions

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped