1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| val spark = SparkSession.builder() .appName("InitSpark") .config("spark.neo4j.bolt.url", properties.getProperty("bolt.url")) .config("spark.neo4j.bolt.user", properties.getProperty("bolt.user")) .config("spark.neo4j.bolt.password", properties.getProperty("bolt.password")) .config("spark.es.write.operation", "upsert") .config("spark.es.index.auto.create", "true") .config("spark.es.nodes", properties.getProperty("es.nodes")) .config("spark.es.port", properties.getProperty("es.port")) .config("spark.es.nodes.wan.only", "true") .config("spark.port.maxRetries", "100") .enableHiveSupport() .getOrCreate() # Neo4jDataFrame.withDataType(sqlContext: SQLContext, query: String, parameters: Seq[(String, Any)], schema: (String, DataType)*) Neo4jDataFrame.withDataType(spark.sqlContext, query, Seq.empty, "id" -> LongType, "nodes" -> StringType)
|