Check whether a OneLake schema or table exists
Source:R/fabric_onelake_table_exists.R
fabric_onelake_schema_exists.RdSearches the paginated Delta metadata collections or retrieves one namespace or table record through the Iceberg REST Catalog API. These helpers avoid downloading table data when only existence is needed.
Usage
fabric_onelake_schema_exists(
item,
schema,
workspace = NULL,
item_type = NULL,
protocol = c("delta", "iceberg"),
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
token = NULL,
auth_args = list(),
api_base = .fabric_api_base,
table_api_base = .fabric_onelake_table_origin,
storage_token = NULL
)
fabric_onelake_table_exists(
item,
table,
workspace = NULL,
schema = NULL,
item_type = NULL,
protocol = c("delta", "iceberg"),
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
token = NULL,
auth_args = list(),
api_base = .fabric_api_base,
table_api_base = .fabric_onelake_table_origin,
storage_token = NULL
)Arguments
- item
Fabric data item GUID, exact display name, or a discovered item object. An object containing
workspaceIdavoids workspace discovery.- schema
Schema or Iceberg namespace name. For a table,
NULLuses the item's discovered default schema and otherwise falls back to"dbo".- workspace
Workspace GUID, exact display name, or discovered workspace. Omit it when
itemcontainsworkspaceId.- item_type
Optional item type used to disambiguate an item supplied by name.
- protocol
OneLake table metadata protocol:
"delta"or"iceberg".- tenant_id
Microsoft Entra tenant ID. Defaults to
FABRICQUERYR_TENANT_ID- client_id
Microsoft Entra application/client ID. Defaults to
FABRICQUERYR_CLIENT_ID, then the Azure CLI application ID- token
Optional access token or token-provider function. Leave
NULLto let 'fabricQueryR' use its normal sign-in flow- auth_args
Additional sign-in options passed to
AzureAuth::get_azure_token()- api_base
Fabric REST API base URL. Leave unchanged unless using a different Fabric cloud or a test service
- table_api_base
OneLake table API HTTPS origin, or a protocol-specific base ending in
/deltaor/iceberg. Most users should keep the default.- storage_token
Optional separate Azure Storage token or token-provider function. Supply it when
tokenis fixed and Fabric item lookup is needed.- table
Table name or a record containing
name,table, ordisplayName. A record can also supply its schema.
Value
One logical value. Delta returns TRUE when the paginated metadata
inventory contains the requested name. Iceberg returns TRUE when the
metadata GET succeeds and FALSE for HTTP 404. Authentication,
permission, throttling, and service errors are not converted to FALSE.
Details
The table APIs use the Azure Storage token audience and require permission to read the item's tables through OneLake. If name-based item discovery is necessary, use the package's normal audience-aware sign-in or token provider because the Fabric Core and Storage audiences are both involved.
Iceberg requests first call GET /iceberg/v1/config with the item's
workspace/item warehouse identity and validate the returned prefix before
retrieving the namespace or table record. Delta requests follow all metadata
collection pages because OneLake currently rejects its documented schema and
table HEAD routes.
Examples
if (FALSE) { # \dontrun{
lakehouse <- fabric_lakehouses(fabric_workspaces()[[1L]])[[1L]]
fabric_onelake_schema_exists(lakehouse, "dbo")
fabric_onelake_table_exists(lakehouse, "orders", schema = "dbo")
fabric_onelake_table_exists(
lakehouse,
"orders",
schema = "dbo",
protocol = "iceberg"
)
} # }