Comments (10)
Hi,
Please share whole code. Probably you are not importing operators DSL:
import ml.sparkling.graph.operators.OperatorsDSL._
please refer to http://sparkling-graph.readthedocs.io/en/latest/eigenvector.html
Please close the issue if all is ok.
from sparkling-graph.
Thank you very much for the quick response.
Actually, I have already checked this link and the problem is there (in the import statement).
Previously, I imported this
import ml.sparkling.graph.operators.OperatorsDSL._
However, it showed me this error "object operators is not a member of package ml.sparkling.graph".
Then I changed it to import ml.sparkling.graph._
I am thinking this import will include the whole classes inside.
Then the error still there "value localClustering is not a member of org.apache.spark.graphx.Graph[Int,Int]".
This is my whole code:
package org.learning.spark
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.storage.StorageLevel
import org.apache.spark.graphx.GraphLoader
import org.apache.spark.graphx.Graph
import org.apache.spark.rdd.RDD
import org.apache.spark.graphx._
import org.apache.spark.graphx.util.GraphGenerators._
import java.util.Calendar
import ml.sparkling.graph.operators.OperatorsDSL._
import ml.sparkling.graph.api.operators.measures.VertexMeasureConfiguration
import org.apache.spark.sql.SQLContext._
import org.apache.spark.sql._
import org.apache.spark.sql.functions._
import org.apache.spark.sql.SQLContext
import org.apache.log4j.{Level, Logger}
object JustForTrying {
def main(args: Array[String]) {
Logger.getLogger("org").setLevel(Level.OFF)
Logger.getLogger("akka").setLevel(Level.OFF)
val master = args(0)
val sourceGraph = args(1)
val compGraph = args(2)
val run = args(3)
val numPart = args(4)
val jobName = args(5)
val runFull = args(6)
val sparkConf: SparkConf = new SparkConf().setAppName(jobName.toString()).setMaster(master)
val sc:SparkContext=new SparkContext(sparkConf)
val sqlContext = new org.apache.spark.sql.SQLContext(sc)
import sqlContext.implicits._
println("Comparing Two Graphs")
val graph: Graph[Int, Int] = GraphLoader.edgeListFile(sc, sourceGraph, canonicalOrientation = true, numEdgePartitions = numPart.toInt, edgeStorageLevel = StorageLevel.MEMORY_AND_DISK_SER, vertexStorageLevel = StorageLevel.MEMORY_AND_DISK_SER)
.partitionBy(PartitionStrategy.RandomVertexCut, numPart.toInt).groupEdges((a, b) => a)
// Local Clustering Score
val clusteringGraph: Graph[Double, Int] = graph.localClustering(VertexMeasureConfiguration(treatAsUndirected=true))
val localCentralityRDD: VertexRDD[Double] = clusteringGraph.vertices
// Eigen Vector Score
val eigenvectorRDD: VertexRDD[Double] = graph.eigenvectorCentrality(VertexMeasureConfiguration(treatAsUndirected=true)).vertices
sc.stop()
}
}
from sparkling-graph.
Problem is here:
"object operators is not a member of package ml.sparkling.graph".
Please show your dependencies, probably you do not have correct one
Do you have:
libraryDependencies += "ml.sparkling" %% "sparkling-graph-operators" % "0.0.8-SNAPSHOT"
from sparkling-graph.
These are my Maven dependencies in the pom.xml File:
junit junit 3.8.1 test <dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-graphx_2.10</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.10</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>ml.sparkling</groupId>
<artifactId>sparkling-graph-api_2.11</artifactId>
<version>0.0.7</version>
</dependency>
from sparkling-graph.
the ml.sparkling is the last dependency
from sparkling-graph.
Yes, that is the problem, you have only API, in order to use the lib you must have appropriate packages. Please try adding:
<dependency>
<groupId>ml.sparkling</groupId>
<artifactId>sparkling-graph-operators_2.11</artifactId>
<version>0.0.7</version>
</dependency>
from sparkling-graph.
Thanks, it works and no error now in the code. However, I got this run time error [in the command Prompt], after executing the spark-submit command. It is regarding the same lines of codes.
Exception in thread "main" java.lang.NoClassDefFoundError: ml/sparkling/graph/operators/OperatorsDSL$
from sparkling-graph.
How are you packaging your application? You must assembly app so your jar will contain all needed classes or you need to put dependencies on spark classpath. (all errors that you are posting here are not problems with SparklingGraph). Please google how to do deploy spark app, it is even mentioned in spark docs
If your code depends on other projects, you will need to package them alongside your application in order to distribute the code to a Spark cluster. To do this, create an assembly jar (or βuberβ jar) containing your code and its dependencies. Both sbt and Maven have assembly plugins.
from sparkling-graph.
Hi,
Please close the issue if all is ok now.
To be clear, that was not an issue with SparklingGraph
from sparkling-graph.
I am closing the issue for now because of lack of response
from sparkling-graph.
Related Issues (19)
- betweenness centrality index HOT 13
- graph frames HOT 7
- [question] Modify EigenvectorCentrality HOT 20
- There is not Betweenness API documentation HOT 3
- Calculate Eigenvector centrality with weight edges HOT 2
- maven repo HOT 11
- please implement scan HOT 4
- Graph frames
- PSCAN cannot find communities HOT 4
- add vertex itself to nodes' neighborhood in PSCAN
- Closeness centrality for a huge graph HOT 1
- Measures implicit methods HOT 2
- Graph generators HOT 1
- Louvian community detection method
- eigensystem solver HOT 3
- License change HOT 1
- graphml writer HOT 8
- Issue with Eigenvector Centrality?! HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparkling-graph.