Microsoft OneDrive connector reference
This feature is in Beta. Workspace admins can control access to this feature from the Previews page by opting into the Lakeflow Connect for OneDrive For Business preview. See Manage Databricks previews.
This page contains reference material for the Microsoft OneDrive connector in Databricks Lakeflow Connect.
onedrive_options parameters
Set these options inside the connector_options.onedrive_options block of each table in your pipeline definition.
Parameter | Type | Required | Description |
|---|---|---|---|
| String | Yes | The URL of the OneDrive for Business My files drive, folder, file, or share link to ingest from. The URL must use a personal |
| String | No | The type of entity to ingest. Supported values: |
| Object | Yes | Controls file format and ingestion behavior. See |
file_ingestion_options parameters
Set these options inside onedrive_options.file_ingestion_options.
Parameter | Type | Required | Description |
|---|---|---|---|
| String | Yes | The file format to ingest. Supported values: |
| Array of objects | No | Filters that restrict which files are ingested. Each filter object can contain one of the following keys:
|
| Boolean | No | Whether to infer the exact data types for structured and semi-structured data. The default is |
| String | No | Controls how new columns in incoming files are handled. Modes match Auto Loader schema evolution modes. Supported values: |
| String | No | Overrides inferred column types. Specify as a comma-separated list of |
| Boolean | No | Whether to skip corrupt files during ingestion. |
| String | No | The column that stores malformed records for formats that support a corrupt-record column. |
| String | No | The column that stores data that does not match the inferred or provided schema. |
| String | No | The column that stores an entire input record as a single |
| Boolean | No | Whether column matching is case-sensitive when rescuing data. |
| Object | No | Format-specific parsing options. Keys are standard Auto Loader format option names. See Format options. |
table_configuration parameters
Set these options inside the table_configuration block of each table in your pipeline definition. table_configuration is a sibling of connector_options, not nested inside it.
Parameter | Type | Required | Description |
|---|---|---|---|
| String | No | The storage mode for the destination table. Supported values:
Because these are the defaults and the only supported values, setting |
Format options
The format_options block accepts standard Auto Loader format option keys for the selected format. Express each value as a string. For example:
"file_ingestion_options": {
"format": "CSV",
"format_options": {
"header": "true",
"sep": ","
}
}
For format-specific option names and behavior, see Spark data source options.
Ingested data format
The schema of the destination table depends on the entity_type and format you configure.
FILE entity type with BINARYFILE format
When entity_type is FILE and format is BINARYFILE, each ingested file becomes one row with the following columns:
Field | Type | Description |
|---|---|---|
|
| The path of the file. |
|
| The time the file was last modified. |
|
| The size of the file in bytes. |
|
| The file content. |
|
| The unique OneDrive identifier of the file. |
|
| Contains OneDrive-specific metadata for the file. See |
|
| Standard file metadata added by Databricks during ingestion. See |
FILE entity type with FILE format
When entity_type is FILE and format is FILE, each ingested file becomes one row with the following columns:
Field | Type | Description |
|---|---|---|
|
| The path of the file. |
|
| The size of the file in bytes. |
|
| The time the file was last modified. |
|
| A managed reference to the copy of the source file in the configured Unity Catalog volume. |
|
| The unique OneDrive identifier of the file. |
|
| Contains OneDrive-specific metadata for the file. See |
|
| Standard file metadata added by Databricks during ingestion. See |
FILE entity type with a structured format
When entity_type is FILE and format is a structured format (CSV, JSON, XML, EXCEL, PARQUET, AVRO, or ORC), the destination table schema matches the schema of the source files, plus the _onedrive_metadata and _file_metadata columns. Columns are inferred from the file contents, subject to the schema_evolution_mode and schema_hints settings.
FILE_METADATA entity type
When entity_type is FILE_METADATA, file content is not downloaded. The destination table contains only the metadata columns from the _onedrive_metadata and _file_metadata structs described above, plus _file_id.
_onedrive_metadata fields
The _onedrive_metadata struct contains the following fields. A field can be null when Microsoft Graph does not return a value.
Field | Type | Description |
|---|---|---|
|
| The unique OneDrive identifier of the file. |
|
| The identifier of the personal SharePoint site that owns the OneDrive drive. |
|
| The OneDrive drive identifier. |
|
| The type of OneDrive drive. |
|
| The identifier of the parent folder. |
|
| The name of the parent folder. |
|
| The path of the parent folder. |
|
| A link to the file in OneDrive. |
|
| The MIME type of the file. |
|
| The email address of the user who created the file. |
|
| The name of the user who created the file. |
|
| The time the file was created in OneDrive. |
|
| The email address of the last user who modified the file. |
|
| The name of the last user who modified the file. |
|
| The entity tag for the file. |
|
| The content tag for the file. |
|
| The description of the file. |
|
| Additional metadata returned by Microsoft Graph that is not represented by another field. |
_file_metadata fields
The _file_metadata struct contains standard file metadata added by Databricks during ingestion:
Field | Type | Description |
|---|---|---|
|
| The source path of the file. |
|
| The name of the file. |
|
| The size of the file in bytes. |
|
| The start byte offset of the file block. |
|
| The length of the file block in bytes. |
|
| The time the file was last modified. |