You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "djouallah (via GitHub)" <gi...@apache.org> on 2024/02/10 12:04:03 UTC

[I] make to_duckdb accept multiple tables [iceberg-python]

djouallah opened a new issue, #408:
URL: https://github.com/apache/iceberg-python/issues/408

   ### Feature Request / Improvement
   
   currently it seems 
   `con =catalog.load_table('aemo.scada').scan().to_duckdb(table_name="scada") `
   accept only 1 table, it will be nice to have something like
   `con =catalog.load_namespace('aemo').scan().to_duckdb()`
   which will expose the whole database to duckdb in one go


-- 
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@iceberg.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] make to_duckdb accept multiple tables [iceberg-python]

Posted by "djouallah (via GitHub)" <gi...@apache.org>.
djouallah closed issue #408: make to_duckdb accept multiple tables 
URL: https://github.com/apache/iceberg-python/issues/408


-- 
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@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] make to_duckdb accept multiple tables [iceberg-python]

Posted by "ischwart1 (via GitHub)" <gi...@apache.org>.
ischwart1 commented on issue #408:
URL: https://github.com/apache/iceberg-python/issues/408#issuecomment-2525291565

   @djouallah 
   
   Apparently you can pass a duckdb connection to `to_duckdb()`, that way you can chain many table together:
   
   ```python
   
   with (
       catalog.load_table(f"{config.lake.namespace}.{config.bronze.map_id}")
       .scan()
       .to_duckdb("bronze_map_id") as con1
   ):
       with (
           catalog.load_table(f"{config.lake.namespace}.{config.bronze.mob}")
           .scan()
           .to_duckdb("bronze_mob", con1) as con2
       ):
           con2.sql("""--sql
           with mob as (
               select unnest(mobs).link as link from bronze_map_id
           ),
           links as (
               select
                   regexp_extract(link, '/mob/(\\d+)', ['mob_id']).mob_id as mob_id,
                   count(*) as count
               from
                   mob
               group by
                   link
           )
           select
                   links.mob_id, name, count
           from
               links
           join
               bronze_mob
           on
               links.mob_id = bronze_mob.id
           """).show(max_width=1000)
   
   ```


-- 
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@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] make to_duckdb accept multiple tables [iceberg-python]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko commented on issue #408:
URL: https://github.com/apache/iceberg-python/issues/408#issuecomment-1941424301

   Thanks for reporting this. I like it! We need to have support for lazy datasets before this becomes feasible.


-- 
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@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] make to_duckdb accept multiple tables [iceberg-python]

Posted by "djouallah (via GitHub)" <gi...@apache.org>.
djouallah commented on issue #408:
URL: https://github.com/apache/iceberg-python/issues/408#issuecomment-2094773725

   is there a way to load two tables, it seems you can only Query 1 table at the time ? 


-- 
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@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org