User Guide > User Guide > Loading Data > Load Data with Spark SQL through the Spark-Vector Connector
Was this helpful?
Load Data with Spark SQL through the Spark-Vector Connector
The Spark-Vector Connector lets you interact with a Vector database using Apache Spark. For more information on the Spark-Vector Connector, see Setting Up Spark for Use with Vector on page 317 and https://github.com/ActianCorp/spark-vector.
To load data using Spark SQL
1. Create a Vector table using Spark SQL:
sqlContext.sql("""CREATE TEMPORARY TABLE vector_table
USING com.actian.spark_vector.sql.DefaultSource
OPTIONS (
host "vectorhost",
instance "VI",
database "databasename",
table "vector_table"
)""")
2. Load data into Vector:
sqlContext.sql("INSERT INTO vector_table SELECT * FROM spark_table")
Last modified date: 01/26/2023