Bug
In R, data_source(con, tables = "ANALYTICS.PUBLIC.ORDERS") folds everything before the last dot into the schema: DBI::Id(schema = "ANALYTICS.PUBLIC", table = "ORDERS"). Quoted, that is "ANALYTICS.PUBLIC"."ORDERS" — one identifier with a dot inside it, naming a schema no warehouse has. The zero-row probe then fails and data_source() errors with a "table does not exist" for a table that does.
id <- DBI::Id(schema = "ANALYTICS.PUBLIC", table = "ORDERS")
DBI::dbQuoteIdentifier(DBI::ANSI(), id)
#> <SQL> "ANALYTICS.PUBLIC"."ORDERS"
The fold dates to 97db857 ("support schema-qualified connection tables", closes #15), written before the package had any catalog support. Catalogs arrived later via DBI::Id(catalog = ...) objects (the Snowflake/Databricks work), and the string parser was never revisited.
R also accepts "a.b.c.d", folding it into a doubly-dotted schema.
Expected
Match the behavior #274 gives the Python side:
"catalog.schema.table" → DBI::Id(catalog = ..., schema = ..., table = ...)
- More than three parts → an error naming the input and pointing at
DBI::Id for literal names containing dots
- One and two parts behave as today
The workaround meanwhile is an explicit DBI::Id(catalog = "ANALYTICS", schema = "PUBLIC", table = "ORDERS").
Shared contract
Table-name parsing is user-observable behavior both packages expose through tables, so the parsing rules belong in tests/shared/ as an executable fixture read by both suites. The fixture cannot land until R is fixed, because R currently fails the three-part case. Being fixed in #274.
Bug
In R,
data_source(con, tables = "ANALYTICS.PUBLIC.ORDERS")folds everything before the last dot into the schema:DBI::Id(schema = "ANALYTICS.PUBLIC", table = "ORDERS"). Quoted, that is"ANALYTICS.PUBLIC"."ORDERS"— one identifier with a dot inside it, naming a schema no warehouse has. The zero-row probe then fails anddata_source()errors with a "table does not exist" for a table that does.The fold dates to 97db857 ("support schema-qualified connection tables", closes #15), written before the package had any catalog support. Catalogs arrived later via
DBI::Id(catalog = ...)objects (the Snowflake/Databricks work), and the string parser was never revisited.R also accepts
"a.b.c.d", folding it into a doubly-dotted schema.Expected
Match the behavior #274 gives the Python side:
"catalog.schema.table"→DBI::Id(catalog = ..., schema = ..., table = ...)DBI::Idfor literal names containing dotsThe workaround meanwhile is an explicit
DBI::Id(catalog = "ANALYTICS", schema = "PUBLIC", table = "ORDERS").Shared contract
Table-name parsing is user-observable behavior both packages expose through
tables, so the parsing rules belong intests/shared/as an executable fixture read by both suites. The fixture cannot land until R is fixed, because R currently fails the three-part case. Being fixed in #274.