Data Connectors

Learn how to use Data Connector to query external data.

Data Connectors provide connections to databases, data warehouses, and data lakes for federated SQL queries and data replication.

Supported Data Connectors include:

NameDescriptionProtocol/Format
databricks (mode: delta_lake)DatabricksS3/Delta Lake
delta_lakeDelta LakeDelta Lake
dremioDremioArrow Flight
duckdbDuckDBEmbedded
githubGitHubGitHub API
postgresPostgreSQL
s3S3Parquet, CSV
mysqlMySQL
delta_lakeDelta LakeDelta Lake
graphqlGraphQLJSON
databricks (mode: spark_connect)DatabricksSpark Connect
flightsqlFlightSQLArrow Flight SQL
mssqlMicrosoft SQL ServerTabular Data Stream (TDS)
snowflakeSnowflakeArrow
sparkSparkSpark Connect
spice.aiSpice.aiArrow Flight
icebergApache IcebergParquet
abfsAzure BlobFSParquet, CSV
clickhouseClickhouse
debeziumDebezium CDCKafka + JSON
dynamodbDynamoDB
ftp, sftpFTP/SFTPParquet, CSV
http, httpsHTTP(s)Parquet, CSV
sharepointMicrosoft SharePointUnstructured UTF-8 documents

Object Store File Formats

For data connectors that are object store compatible, if a folder is provided, the file format must be specified with params.file_format.

If a file is provided, the file format will be inferred, and params.file_format is unnecessary.

File formats currently supported are:

NameParameterSupportedIs Document Format
Apache Parquetfile_format: parquet✅❌
CSVfile_format: csv✅❌
Apache Icebergfile_format: icebergRoadmap❌
JSONfile_format: jsonRoadmap❌
Microsoft Excelfile_format: xlsxRoadmap❌
Markdownfile_format: md✅✅
Textfile_format: txt✅✅
PDFfile_format: pdfAlpha✅
Microsoft Wordfile_format: docxAlpha✅

File formats support additional parameters in the params (like csv_has_header) described in File Formats

If a format is a document format, each file will be treated as a document, as per document support below.

Identifier Case Sensitivity and Quoting

Spice follows PostgreSQL conventions for identifier handling: unquoted identifiers are normalized to lowercase. This applies to both the from field in dataset definitions and the name field used for SQL queries.

Quoting in the from field

To reference a table or schema with mixed-case or uppercase characters in the from field, wrap each case-sensitive part in double quotes:

datasets:
  # Without quoting — "ActionExecutions" is lowercased to "actionexecutions"
  - from: postgres:my_schema.ActionExecutions
    name: action_executions

  # With quoting — case is preserved for the table name
  - from: postgres:my_schema."ActionExecutions"
    name: action_executions

  # Quote each part individually as needed
  - from: postgres:"MySchema"."ActionExecutions"
    name: action_executions

Each dotted part of the identifier is treated independently — quote only the parts that require case preservation. For example, postgres:my_schema."ActionExecutions" preserves the case of ActionExecutions while my_schema is normalized to lowercase.

This applies to all federated database connectors where the from field references a table identifier (e.g. postgres, mysql, snowflake, databricks, clickhouse, mssql, duckdb, dremio, flightsql, spark, mongodb, oracle). Connectors that interpret from as a file path (e.g. s3, delta_lake, ftp, abfs) do not apply identifier normalization.

Quoting in the name field

The name field controls the table name used in Spice SQL queries and follows the same lowercase normalization. To preserve case in the dataset name, wrap the value in double quotes. In YAML, use single quotes around the double-quoted value:

datasets:
  - from: postgres:my_schema."ActionExecutions"
    name: '"ActionExecutions"'
-- Query using the preserved-case name
SELECT * FROM "ActionExecutions";

If you don't need to preserve case in queries, a lowercase name works without quoting:

datasets:
  - from: postgres:my_schema."ActionExecutions"
    name: action_executions
SELECT * FROM action_executions;

Dataset name quoting works regardless of connector type.