View source: R/fabric_onelake_read_delta_table.R
| fabric_onelake_read_delta_table | R Documentation |
Authenticates to OneLake (ADLS Gen2), resolves the table's
_delta_log to determine the current active Parquet parts,
downloads only those parts to a local staging directory, and
returns the result as a tibble.
fabric_onelake_read_delta_table(
table_path,
workspace_name,
lakehouse_name,
schema = NULL,
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
dest_dir = NULL,
verbose = TRUE,
dfs_base = "https://onelake.dfs.fabric.microsoft.com"
)
table_path |
Character. Table name or nested path (e.g.
|
workspace_name |
Character. Fabric workspace display name or GUID (this is the ADLS filesystem/container name). |
lakehouse_name |
Character. Lakehouse item name, with or without the
|
schema |
Character or |
tenant_id |
Character. Entra ID (Azure AD) tenant GUID. Defaults to
|
client_id |
Character. App registration (client) ID. Defaults to
|
dest_dir |
Character or |
verbose |
Logical. Print progress messages via |
dfs_base |
Character. OneLake DFS endpoint. Default
|
In Microsoft Fabric, OneLake exposes each workspace as an ADLS Gen2
filesystem. Within a Lakehouse item, Delta tables are stored under
Tables/<table> (non-schema lakehouse) or Tables/<schema>/<table>
(schema-enabled lakehouse) with a _delta_log/ directory that tracks
commit state. This helper replays the JSON commits to avoid
double-counting compacted/removed files.
Schema-enabled lakehouses (the default for new lakehouses) organise
tables into named schemas. Supply the schema argument (e.g. "dbo")
to read a table stored under a specific schema.
Ensure the account/principal you authenticate with has access via Lakehouse -> Manage OneLake data access (or is a member of the workspace).
AzureAuth is used to acquire the token. Be wary of
caching behavior; you may want to call AzureAuth::clean_token_directory()
to clear cached tokens if you run into issues
A tibble with the table's current rows (0 rows if the table is empty).
# Example is not executed since it requires configured credentials for Fabric
## Not run:
df <- fabric_onelake_read_delta_table(
table_path = "Patients/PatientInfo",
workspace_name = "PatientsWorkspace",
lakehouse_name = "Lakehouse.Lakehouse",
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID")
)
dplyr::glimpse(df)
# Schema-enabled lakehouse: read from Tables/dbo/PatientInfo
df2 <- fabric_onelake_read_delta_table(
table_path = "PatientInfo",
workspace_name = "PatientsWorkspace",
lakehouse_name = "Lakehouse.Lakehouse",
schema = "dbo"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.