Data FlowData Flow
DataFlow
  • User Manual
  • Developer Manual
  • Examples
  • API Reference
Overview
Getting Started
Pipeline Authoring
    Pipeline Spec OverviewConnections
    Sources
      SourcesJDBC SourcesNoSQL SourcesFile System SourcesObject Storage SourcesAPI SourcesStream Sources
    Transforms
    Destinations
    Execution Settings
Execution
Deployment
Troubleshooting
Examples
Sources

NoSQL Sources

NoSQL sources read from MongoDB, Cassandra, DynamoDB, Cosmos DB, HBase, Elasticsearch, Solr, Firestore, RethinkDB, or CouchDB, one collection or table per asset.

Providers: mongodb | cassandra | dynamodb | cosmosdb | hbase | elasticsearch | solr | firestore | rethinkdb | couchdb

Asset fields

Every asset in this type carries these fields; provider and format values live under options.

FieldTypeDefaultNotes
name (required)string--
chainobject-Per-row iteration over a previously loaded asset. When set, offset is not allowed.
chain.from (required)string-FQN of a previous asset whose distinct rows drive per-row iteration (e.g. sources.source_name.asset_name).
chain.pass_columns (required)boolean-When true, prepend the parent row's columns onto every result row produced by that chained iteration.
chain.prepend_labelstring-Optional prefix concatenated onto passed parent column names to avoid name conflicts (e.g. 'right_').
tablestring--
querystring--
schemastring-Optional schema definition for jdbc-based sources (e.g., psql, mysql, mssql, oracle...). Format: 'field1 type1, field2 type2, ...' or multi-line string for better readability.
offsetobject--
offset.key (required)string--
offset.response_keystring--
offset.initial_value (required)string-Initial offset value.
offset.type (required)timestamp or datetime or date or integer or int or long or id or string or text or cursor or token or page--
offset.formatstring-Optional target format used to reformat the value extracted from response_key so it matches the requestParam format expected by the API. Applied only when type is 'timestamp' or 'integer'. For timestamp: 'iso8601' (default), 'epoch_millis', 'epoch_seconds', or any DateTimeFormatter pattern (e.g. 'yyyy-MM-dd'). For integer: any java.util.Formatter pattern (e.g. '%d', '%08d', '%x').

Minimal example

A complete nosql source with one asset, written for provider mongodb:

Code
sources: - name: orders type: nosql provider: mongodb # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: mongodb://<host>:27017 database: <database> auth: user: <user> password: <password> assets: - name: orders_raw table: <collection>

Providers

mongodb

An example for provider mongodb:

Code
sources: - name: orders type: nosql provider: mongodb # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: mongodb://<host>:27017 database: <database> auth: user: <user> password: <password> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
auth (required)object--
auth.user (required)string--
auth.password (required)string--

Asset options

assets[].options:

FieldTypeDefaultNotes
commentstring-The comment to append to the read operation. Comments appear in the output of the Database Profiler.
modeFAILFAST or PERMISSIVE or DROPMALFORMED-The parsing strategy to use when handling documents that don't match the expected schema. FAILFAST: Throws an exception when parsing a document that doesn't match the schema. PERMISSIVE: Sets fields to null when data types don't match the schema. DROPMALFORMED: Ignores any document that doesn't match the schema. Default: FAILFAST.
column_name_of_corrupt_recordstring-If you set the mode option to PERMISSIVE, this option specifies the name of the new column that stores the invalid document as extended JSON. Maps to columnNameOfCorruptRecord.
mongo_client_factorystring-MongoClientFactory configuration key. You can specify a custom implementation which must implement the com.mongodb.spark.sql.connector.connection.MongoClientFactory interface. Default: com.mongodb.spark.sql.connector.connection.DefaultMongoClientFactory. Maps to mongoClientFactory.
partitionerstring-The partitioner full class name. You can specify a custom implementation that must implement the com.mongodb.spark.sql.connector.read.partitioner.Partitioner interface. Default: com.mongodb.spark.sql.connector.read.partitioner.SamplePartitioner.
auto_bucket_partition_field_liststring-The list of fields to use for partitioning. The value can be either a single field name or a list of comma-separated fields. Default: _id. Maps to partitioner.options.partition.fieldList.
auto_bucket_partition_chunk_sizenumber-The average size (MB) for each partition. Smaller partition sizes create more partitions containing fewer documents. Default: 64. Maps to partitioner.options.partition.chunkSize.
auto_bucket_samples_per_partitioninteger-The number of samples to take per partition. Default: 100. Maps to partitioner.options.partition.samplesPerPartition.
auto_bucket_partition_key_projection_fieldstring-The field name to use for a projected field that contains all the fields used to partition the collection. Default: __idx. Maps to partitioner.options.partition.partitionKeyProjectionField.
partition_fieldstring-The field to use for partitioning, which must be a unique field. Default: _id. Maps to partitioner.options.partition.field.
partition_sizenumber-The size (in MB) for each partition. Smaller partition sizes create more partitions containing fewer documents. Default: 64. Maps to partitioner.options.partition.size.
samples_per_partitioninteger-The number of samples to take per partition. Default: 10. Maps to partitioner.options.samples.per.partition.
max_partitions_numberinteger-The number of partitions to create. Default: 64. Maps to partitioner.options.max.number.of.partitions.
sample_sizeinteger-The number of documents to sample from the collection when inferring the schema. Default: 1000. Maps to sampleSize.
enable_infer_schema_map_typesboolean-Whether to enable Map types when inferring the schema. When enabled, large compatible struct types are inferred to a MapType instead. Default: true. Maps to sql.inferSchema.mapTypes.enabled.
infer_schema_map_types_min_key_sizeinteger-Minimum size of a StructType before inferring as a MapType. Default: 250. Maps to sql.inferSchema.mapTypes.minimum.key.size.
allow_disk_useboolean-Specifies whether to allow storage to disk when running the aggregation. Default: true. Maps to aggregation.allowDiskUse.
output_extended_jsonboolean-When true, the connector converts BSON types not supported by Spark into extended JSON strings. When false, the connector uses the original relaxed JSON format for unsupported types. Default: false. Maps to outputExtendedJson.
schema_hintsstring-Specifies a partial schema of known field types to use when inferring the schema for the collection. Maps to schemaHints.
stream_lookup_full_documentdefault or updateLookup-Determines what values your change stream returns on update operations. The default setting returns the differences between the original document and the updated document. The updateLookup setting also returns the differences but includes a copy of the entire updated document. Default: default. Maps to change.stream.lookup.full.document.
stream_lookup_full_document_before_changedefault or off or whenAvailable or required-Specifies whether to return the full document before the change. Default: false. Maps to change.stream.lookup.full.document.before.change.
stream_micro_batch_max_partition_countinteger-The maximum number of partitions the Spark Connector divides each micro-batch into. Spark workers can process these partitions in parallel. This setting applies only when using micro-batch streams. Default: 1. Maps to change.stream.micro.batch.max.partition.count.
stream_publish_full_document_onlyboolean-Specifies whether to publish the changed document or the full change stream document. When this setting is true, the connector filters out messages that omit the fullDocument field and publishes only the value of the field. Default: false. Maps to change.stream.publish.full.document.only.
stream_startup_modelatest or timestamp-Specifies how the connector starts up when no offset is available. latest: The connector begins processing change events starting with the most recent event. timestamp: The connector begins processing change events at a specified time. Default: latest. Maps to change.stream.startup.mode.
stream_startup_mode_timestampstring-Specifies the time to start processing change events when using timestamp startup mode. Accepts timestamps in the following formats: An integer representing the number of seconds since the Unix epoch, A date and time in ISO-8601 format with one-second precision, An extended JSON BsonTimestamp. Maps to change.stream.startup.mode.timestamp.start.at.operation.time.

cassandra

An example for provider cassandra:

Code
sources: - name: orders type: nosql provider: cassandra # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: <host>:9042 database: <database> auth: user: <user> password: <password> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
auth (required)object--
auth.user (required)string--
auth.password (required)string--

Asset options

assets[].options:

FieldTypeDefaultNotes
wherestring-CQL WHERE clause to filter rows. Only supports partition key columns and clustering columns.
pushdownboolean-Enable or disable predicate pushdown. Default: true.
split_countinteger-Number of Spark partitions to create. If not specified, the connector will determine the optimal number based on the table size. Maps to splitCount.
split_sizenumber-Target partition size (MB) for Spark partitions. Default: 64. Maps to splitSizeInMB.
fetch_sizeinteger-The number of rows to fetch at a time. Default: 1000. Maps to fetchSizeInRows.
consistency_levelALL or EACH_QUORUM or QUORUM or LOCAL_QUORUM or ONE or TWO or THREE or LOCAL_ONE or ANY or SERIAL or LOCAL_SERIAL-Consistency level for read operations. Maps to consistencyLevel.
reads_throughputinteger-Read throughput limit in requests per second per core. Maps to readsPerSec.
reads_throughput_mbnumber-Read throughput limit (MB) per second per core. Maps to throughputMBPerSec.

dynamodb

An example for provider dynamodb:

Code
sources: - name: orders type: nosql provider: dynamodb # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: https://dynamodb.<region>.amazonaws.com database: <database> auth: access_key: <access_key> secret_key: <secret_key> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
auth (required)object--
auth.access_key (required)string--
auth.secret_key (required)string--
auth.regionstring--

Asset options

assets[].options:

FieldTypeDefaultNotes
scan_segmentsinteger-Number of parallel scan segments. Higher values increase parallelism but may consume more read capacity. Maps to scanSegments.
read_throughputnumber-Read throughput limit in read capacity units per second. Maps to readThroughput.

cosmosdb

An example for provider cosmosdb:

Code
sources: - name: orders type: nosql provider: cosmosdb # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: https://<account>.documents.azure.com:443 database: <database> auth: account_key: <account_key> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
auth (required)object--
auth.account_key (required)string--

Asset options

assets[].options:

FieldTypeDefaultNotes
read_custom_querystring-Custom SQL query to filter documents. If not specified, all documents in the container are read. Maps to spark.cosmos.read.customQuery.
read_infer_schema_enabledboolean-Enable schema inference from documents. Default: true. Maps to spark.cosmos.read.inferSchema.enabled.
read_infer_schema_sample_sizeinteger-Number of documents to sample for schema inference. Default: 1000. Maps to spark.cosmos.read.inferSchema.samplingSize.
read_infer_schema_include_system_propertiesboolean-Include system properties (_ts, _etag, etc.) in inferred schema. Default: false. Maps to spark.cosmos.read.inferSchema.includeSystemProperties.
read_partitioning_strategyDefault or Restrictive or Custom-Partitioning strategy for reading data. Default: Default. Maps to spark.cosmos.read.partitioning.strategy.
read_max_item_countinteger-Maximum number of items to return per page. Default: 1000. Maps to spark.cosmos.read.maxItemCount.

hbase

An example for provider hbase:

Code
sources: - name: orders type: nosql provider: hbase # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: <host>:2181 database: <database> assets: - name: orders_raw table: <collection> catalog: <catalog>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
authobject--
auth.userstring--
auth.passwordstring--

Asset options

assets[].options:

FieldTypeDefaultNotes
use_hbase_contextbooleanfalseWhether to use HBaseContext for optimized operations. Default: true. Maps to hbase.spark.use.hbasecontext.
push_down_predicateboolean-Enable predicate pushdown to HBase. Default: true. Maps to pushDownPredicate.
timestampstring-Timestamp to use for reading data. Can be a specific timestamp or 'latest'.
timestamp_rangestring-Timestamp range for reading data in format 'startTimestamp,endTimestamp'. Maps to timestampRange.
max_versionsinteger-Maximum number of versions to return per cell. Maps to maxVersions.

elasticsearch

An example for provider elasticsearch:

Code
sources: - name: orders type: nosql provider: elasticsearch # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: http://<host>:9200 database: <database> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--

auth is one of:

Variant

Variant

Asset options

assets[].options:

FieldTypeDefaultNotes
read_metadataboolean-Include document metadata (_id, _index, _type, etc.) in the returned DataFrame. Default: false. Maps to es.read.metadata.
read_metadata_fieldstring-Field name to store document metadata. Default: _metadata. Maps to es.read.metadata.field.
read_field_includestring-Comma-separated list of fields to include in the result. If not specified, all fields are included. Maps to es.read.field.include.
read_field_excludestring-Comma-separated list of fields to exclude from the result. Maps to es.read.field.exclude.
input_max_docs_per_partitioninteger-Maximum number of documents per partition. Controls parallelism for large datasets. Maps to es.input.max.docs.per.partition.
nodes_wan_onlybooleantrueSet to true if connecting over WAN or through a load balancer. Disables node discovery. Default: false. Maps to es.nodes.wan.only.
sslboolean-Enable SSL/TLS for connections. Default: false. Maps to es.net.ssl.

solr

An example for provider solr:

Code
sources: - name: orders type: nosql provider: solr # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: http://<host>:8983/solr database: <database> auth: user: <user> password: <password> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
auth (required)object--
auth.user (required)string--
auth.password (required)string--

Asset options

assets[].options:

FieldTypeDefaultNotes
fieldsstring-Comma-separated list of fields to retrieve. Can use field alias syntax (e.g., author) or function queries with aliases. If not specified, all stored fields are returned.
filtersstring-Comma-separated list of filter queries to apply (e.g., firstName,lastName).
fetch_sizeinteger-Number of rows to retrieve from Solr per request (page size). This is not the maximum number of rows - all matching rows are read. Default: 1000. Maps to rows.
max_rowsinteger-Limits the result set to a maximum number of rows. Only applies when using /select handler. Should not be used for large values. Default: None.
request_handlerstring-Solr request handler for queries. Use /export handler to stream data out of Solr (requires fields to be explicitly specified). Default: /select.
splitsboolean-Enable shard splitting on default field version to increase parallelism when Spark cluster has more executor slots than shards. Default: false.
split_fieldstring-Field to split on for intra-shard splitting. Should have sufficient variance in values. Default: version.
splits_per_shardinteger-Number of splits per shard for increased parallelism. This is a hint and actual splits may vary. Default: 1.
flatten_multivaluedboolean-Flatten multi-valued fields from Solr. Default: true.
doc_valuesboolean-Fetch docValues that are indexed but not stored by using function queries. Should be used for Solr versions lower than 5.5.0. Default: false. Maps to dv.
skip_non_doc_valuesboolean-Skip all fields that are not docValues. Default: false. Maps to skip_non_dv.
sample_seedinteger-Read a random sample of documents from Solr using the specified seed. When provided, a 10% sample is read by default (use sample_pct to control). Default: None.
sample_pctnumber-Size of random sample as a value between 0 and 1. Used with sample_seed. Default: 0.1.
solr_paramsstring-Arbitrary Solr parameters in the form of a Solr query string (e.g., fq=userId:[10 TO 1000]). Use only for parameters NOT covered by other options. Maps to solr.params.
partition_bystring-Set to 'time' to query multiple time series collections partitioned according to time period.
time_periodstring-Time period format: X DAYS/HOURS/MINUTES (e.g., 1MINUTES). Should match the time period with which partitions are created. Default: 1DAYS.
datetime_patternstring-DateTime pattern for time series partitions. Can be inferred from time_period. Default: yyyy_MM_dd.
timestamp_field_namestring-Field name in indexed documents where timestamp is found. Default: timestamp_tdt.
timezone_idstring-Timezone ID for time series queries. Default: UTC.
max_active_partitionsinteger-Maximum number of partitions allowed at a time for time series queries. Default: null.

firestore

An example for provider firestore:

Code
sources: - name: orders type: nosql provider: firestore # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: project_id: <project_id> database: <database> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
project_id (required)string--
database (required)string--
urlstring--
authobject-Firestore auth. Provide service_account_json for GCP; omit for the emulator or to use Application Default Credentials.
auth.service_account_json (required)string-Inline GCP service account JSON.

Asset options

assets[].options:

FieldTypeDefaultNotes
order_bystring-Field name to order results by. Maps to orderBy.
limit_to_firstinteger-Limit the number of results returned, starting from the first. Maps to limitToFirst.
limit_to_lastinteger-Limit the number of results returned, starting from the last. Maps to limitToLast.

rethinkdb

An example for provider rethinkdb:

Code
sources: - name: orders type: nosql provider: rethinkdb # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: <host>:28015 database: <database> auth: user: <user> password: <password> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
auth (required)object--
auth.user (required)string--
auth.password (required)string--

Asset options

assets[].options:

FieldTypeDefaultNotes
timeoutinteger-Connection timeout in seconds. Default: 20.
read_modesingle or majority or outdated-Read mode for queries. Default: single. Maps to readMode.

couchdb

An example for provider couchdb:

Code
sources: - name: orders type: nosql provider: couchdb # Reuse a saved connection instead of the fields below: # connection_name: <name> settings: url: http://<host>:5984 database: <database> auth: user: <user> password: <password> assets: - name: orders_raw table: <collection>

Connection

Use settings.connection_name for a saved connection, or configure it inline:

FieldTypeDefaultNotes
url (required)string--
database (required)string--
auth (required)object--
auth.user (required)string--
auth.password (required)string--

Related pages

  • Sources
  • Connections
  • Pipeline Spec Overview
  • API Reference
Suggest edit
Last modified on November 26, 2026
JDBC SourcesFile System Sources
On this page
  • Asset fields
  • Minimal example
  • Providers
    • mongodb
    • cassandra
    • dynamodb
    • cosmosdb
    • hbase
    • elasticsearch
    • solr
    • firestore
    • rethinkdb
    • couchdb
  • Related pages
YAML
YAML
YAML
YAML
YAML
YAML
YAML
YAML
YAML
YAML
YAML