You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2024/10/14 19:45:13 UTC

[I] Clarify documentation on ADBC_GET_OBJECTS_DEPTH values [arrow-adbc]

paleolimbot opened a new issue, #2248:
URL: https://github.com/apache/arrow-adbc/issues/2248

   ### What happened?
   
   As discovered in https://github.com/OSGeo/gdal/pull/11003#discussion_r1799512036 , the documentation for `ADBC_OBJECT_DEPTH_DB_SCHEMAS` suggests that using its value will result in table metadata; however, using `ADBC_OBJECT_DEPTH_DB_TABLES` is required to actually get a list of tables.
   
   https://github.com/apache/arrow-adbc/blob/cd24bc096612feeef31bff2a9271616cc94e1634/c/include/arrow-adbc/adbc.h#L503-L522
   
   ``` r
   library(adbcdrivermanager)
   
   con <- adbc_database_init(adbcsqlite::adbcsqlite()) |> 
     adbc_connection_init()
   
   
   mtcars |> 
     write_adbc(con, "some_table")
   
   adbc_connection_get_objects(con, depth = 1L) |> 
     tibble::as_tibble() |> 
     tidyr::unnest_longer(catalog_db_schemas) |> 
     tidyr::unnest_wider(catalog_db_schemas) |> 
     tidyr::unnest_longer(db_schema_tables) |> 
     tidyr::unnest_wider(db_schema_tables) |> 
     dplyr::select(-table_constraints) |> 
     tidyr::unnest_longer(table_columns)
   #> # A tibble: 0 × 5
   #> # ℹ 5 variables: catalog_name <chr>, db_schema_name <chr>, table_name <chr>,
   #> #   table_type <chr>, table_columns <df[,19]>
   
   adbc_connection_get_objects(con, depth = 2L) |> 
     tibble::as_tibble() |> 
     tidyr::unnest_longer(catalog_db_schemas) |> 
     tidyr::unnest_wider(catalog_db_schemas) |> 
     tidyr::unnest_longer(db_schema_tables) |> 
     tidyr::unnest_wider(db_schema_tables) |> 
     dplyr::select(-table_constraints) |> 
     tidyr::unnest_longer(table_columns)
   #> # A tibble: 1 × 5
   #>   catalog_name db_schema_name table_name table_type table_columns$column_name
   #>   <chr>        <chr>          <chr>      <chr>      <chr>                    
   #> 1 main         ""             <NA>       <NA>       <NA>                     
   #> # ℹ 18 more variables: table_columns$ordinal_position <int>, $remarks <chr>,
   #> #   $xdbc_data_type <int>, $xdbc_type_name <chr>, $xdbc_column_size <int>,
   #> #   $xdbc_decimal_digits <int>, $xdbc_num_prec_radix <int>,
   #> #   $xdbc_nullable <int>, $xdbc_column_def <chr>, $xdbc_sql_data_type <int>,
   #> #   $xdbc_datetime_sub <int>, $xdbc_char_octet_length <int>,
   #> #   $xdbc_is_nullable <chr>, $xdbc_scope_catalog <chr>,
   #> #   $xdbc_scope_schema <chr>, $xdbc_scope_table <chr>, …
   
   adbc_connection_get_objects(con, depth = 3L) |> 
     tibble::as_tibble() |> 
     tidyr::unnest_longer(catalog_db_schemas) |> 
     tidyr::unnest_wider(catalog_db_schemas) |> 
     tidyr::unnest_longer(db_schema_tables) |> 
     tidyr::unnest_wider(db_schema_tables) |> 
     dplyr::select(-table_constraints) |> 
     tidyr::unnest_longer(table_columns)
   #> # A tibble: 1 × 5
   #>   catalog_name db_schema_name table_name table_type table_columns$column_name
   #>   <chr>        <chr>          <chr>      <chr>      <chr>                    
   #> 1 main         ""             some_table table      <NA>                     
   #> # ℹ 18 more variables: table_columns$ordinal_position <int>, $remarks <chr>,
   #> #   $xdbc_data_type <int>, $xdbc_type_name <chr>, $xdbc_column_size <int>,
   #> #   $xdbc_decimal_digits <int>, $xdbc_num_prec_radix <int>,
   #> #   $xdbc_nullable <int>, $xdbc_column_def <chr>, $xdbc_sql_data_type <int>,
   #> #   $xdbc_datetime_sub <int>, $xdbc_char_octet_length <int>,
   #> #   $xdbc_is_nullable <chr>, $xdbc_scope_catalog <chr>,
   #> #   $xdbc_scope_schema <chr>, $xdbc_scope_table <chr>, …
   
   adbc_connection_get_objects(con, depth = 0L) |> 
     tibble::as_tibble() |> 
     tidyr::unnest_longer(catalog_db_schemas) |> 
     tidyr::unnest_wider(catalog_db_schemas) |> 
     tidyr::unnest_longer(db_schema_tables) |> 
     tidyr::unnest_wider(db_schema_tables) |> 
     dplyr::select(-table_constraints) |> 
     tidyr::unnest_longer(table_columns)
   #> # A tibble: 1 × 5
   #>   catalog_name db_schema_name table_name table_type   table_columns
   #>   <chr>        <chr>          <chr>      <chr>      <list<df[,19]>>
   #> 1 main         ""             some_table table            [11 × 19]
   ```
   
   <sup>Created on 2024-10-14 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup>
   
   ### Stack Trace
   
   _No response_
   
   ### How can we reproduce the bug?
   
   _No response_
   
   ### Environment/Setup
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Clarify documentation on ADBC_GET_OBJECTS_DEPTH values [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #2248: Clarify documentation on ADBC_GET_OBJECTS_DEPTH values
URL: https://github.com/apache/arrow-adbc/issues/2248


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Clarify documentation on ADBC_GET_OBJECTS_DEPTH values [arrow-adbc]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #2248:
URL: https://github.com/apache/arrow-adbc/issues/2248#issuecomment-2412081727

   Ooops, ignore me, it's just that the `\brief` is a little misleading here because it applies to the *next* one. It might not hurt to add a blank line between them to prevent this mistake from happening again!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Clarify documentation on ADBC_GET_OBJECTS_DEPTH values [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #2248: Clarify documentation on ADBC_GET_OBJECTS_DEPTH values
URL: https://github.com/apache/arrow-adbc/issues/2248


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org