title: How to create a simple spark graphframe using java?
body: <p>Basically I am a java developer &amp; now I got a chance to work on Spark &amp; I gone through basics of the Spark api like what is SparkConfig, SparkContaxt, RDD, SQLContaxt, DataFrame, DataSet &amp; then I able to perform some simple simple transformations using RDD, SQL.... but when I try to workout some sample graphframe application using java then I can'able to succeed &amp; I gone through so many youtube tutorials, forums &amp; stackoverflow threads but no where I haven't find any direct suggestion or solution.Actually I facing this issue when I try to create a object to GraphFrame class &amp; I have downloaded receptive jar(<strong>graphframes-0.2.0-spark2.0-s_2.11.jar</strong>) too but still facing issue now I want put my analysis till where I reach due to very new to Spark I can't able to move further so if someone help me it's really helpful to all. Thanks in advance. The exception is I am facing <strong>The constructor GraphFrame(DataFrame, DataFrame) is undefined</strong></p>
  
  <pre><code>import java.io.IOException;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  
  import org.apache.spark.SparkConf;
  import org.apache.spark.api.java.JavaRDD;
  import org.apache.spark.api.java.JavaSparkContext;
  import org.apache.spark.sql.DataFrame;
  import org.apache.spark.sql.Row;
  import org.apache.spark.sql.RowFactory;
  import org.apache.spark.sql.SQLContext;
  import org.apache.spark.sql.types.DataTypes;
  import org.apache.spark.sql.types.StructField;
  import org.apache.spark.sql.types.StructType;
  import org.apache.spark.storage.StorageLevel;
  import org.graphframes.GraphFrame;
  
  import com.fasterxml.jackson.core.JsonParseException;
  import com.fasterxml.jackson.databind.JsonMappingException;
  
  public class SparkJavaGraphFrameOne {
  
      public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException{
  
          SparkConf conf = new SparkConf().setAppName("test").setMaster("local");
  
          JavaSparkContext sc = new JavaSparkContext(conf);
          SQLContext sqlContext = new org.apache.spark.sql.SQLContext(sc);
  
          JavaRDD&lt;Row&gt; verRow = sc.parallelize(Arrays.asList(RowFactory.create(1,"A"),RowFactory.create(2,"B")));
          JavaRDD&lt;Row&gt; edgRow = sc.parallelize(Arrays.asList(RowFactory.create(1,2,"Edge")));     
  
          List&lt;StructField&gt; verFields = new ArrayList&lt;StructField&gt;();
          verFields.add(DataTypes.createStructField("id",DataTypes.IntegerType, true));
          verFields.add(DataTypes.createStructField("name",DataTypes.StringType, true));
  
          List&lt;StructField&gt; EdgFields = new ArrayList&lt;StructField&gt;();
          EdgFields.add(DataTypes.createStructField("fromId",DataTypes.IntegerType, true));
          EdgFields.add(DataTypes.createStructField("toId",DataTypes.IntegerType, true));
          EdgFields.add(DataTypes.createStructField("name",DataTypes.StringType, true));
  
          StructType verSchema = DataTypes.createStructType(verFields);
          StructType edgSchema = DataTypes.createStructType(EdgFields);
  
          DataFrame verDF = sqlContext.createDataFrame(verRow, verSchema);
          DataFrame edgDF = sqlContext.createDataFrame(edgRow, edgSchema);
  
          GraphFrame g = new GraphFrame(verDF,edgDF);
          g.vertices().show();
          g.edges().show();
          g.persist(StorageLevel.MEMORY_AND_DISK());
      }
  
  }
  </code></pre>