You can run SQL queries with Spark on TileDB arrays as follows:
// Create a dataframe from a TileDB arrayval df = spark.read .format("io.tiledb.spark") .option("uri", "s3://my_bucket/my_array") .load()// Create a view and run SQLdf.createOrReplaceTempView("tiledbArray");val sql_df = spark.sql("SELECT * FROM tiledbArray")sql_df.show()
# Create a dataframe from a TileDB arraydf = spark.read.format("io.tiledb.spark").option("uri", "s3://my_bucket/my_array").load()# Create a view and run SQLdf.createOrReplaceTempView("tiledbArray");sql_df = spark.sql("SELECT * FROM tiledbArray")sql_df.show()
# Create a dataframe from a TileDB arraydf <-read.df(uri ="s3://my_bucket/array_new", source ="io.tiledb.spark")# Create a view and run SQLcreateOrReplaceTempView(df, "tiledbArray")sql_df <-sql("select * from tiledbArray")head(sql_df)