/root/spark-project/my_reader.scala:1: error: object NebulaConnectionConfig is not a member of package com.vesoft.nebula
import com.vesoft.nebula.NebulaConnectionConfig
^
/root/spark-project/my_reader.scala:2: error: object configs is not a member of package com.vesoft.nebula.client.meta
import com.vesoft.nebula.client.meta.configs.ReadNebulaConfig
^
/root/spark-project/my_reader.scala:3: error: object sql is not a member of package org.apache.spark
import org.apache.spark.sql.SparkSession
^
/root/spark-project/my_reader.scala:7: error: not found: value SparkSession
val spark = SparkSession.builder()
^
/root/spark-project/my_reader.scala:11: error: not found: value NebulaConnectionConfig
val config = NebulaConnectionConfig
^
/root/spark-project/my_reader.scala:19: error: not found: type ReadNebulaConfig
val nebulaReadVertexConfig: ReadNebulaConfig = ReadNebulaConfig
^
/root/spark-project/my_reader.scala:19: error: not found: value ReadNebulaConfig
val nebulaReadVertexConfig: ReadNebulaConfig = ReadNebulaConfig
^
import com.vesoft.nebula.connector.{NebulaConnectionConfig, ReadNebulaConfig}
import org.apache.spark.sql.SparkSession
object MyReader {
def main(args: Array[String]): Unit = {
val spark = SparkSession
.builder()
.appName("My Reader")
.getOrCreate()
val config = NebulaConnectionConfig
.builder()
.withMetaAddress("")
.withConnectionRetry(2)
.withExecuteRetry(2)
.withTimeout(6000)
.build()
val nebulaReadVertexConfig: ReadNebulaConfig = ReadNebulaConfig
.builder()
.withSpace("my_space_1")
.withLabel("team")
.withNoColumn(false)
.withReturnCols(List())
.withLimit(10)
.withPartitionNum(10)
.build()
val vertex = spark.read.nebula(config, nebulaReadVertexConfig).loadVerticesToDF()
spark.stop()
}
}
报错:
/root/spark-project/my_reader.scala:1: error: object vesoft is not a member of package com
import com.vesoft.nebula.connector.{NebulaConnectionConfig, ReadNebulaConfig}
^
/root/spark-project/my_reader.scala:2: error: object apache is not a member of package org
import org.apache.spark.sql.SparkSession
^
/root/spark-project/my_reader.scala:6: error: not found: value SparkSession
val spark = SparkSession
^
/root/spark-project/my_reader.scala:11: error: not found: value NebulaConnectionConfig
val config = NebulaConnectionConfig
^
/root/spark-project/my_reader.scala:19: error: not found: type ReadNebulaConfig
val nebulaReadVertexConfig: ReadNebulaConfig = ReadNebulaConfig
^
/root/spark-project/my_reader.scala:19: error: not found: value ReadNebulaConfig
val nebulaReadVertexConfig: ReadNebulaConfig = ReadNebulaConfig
^