Code Monkey home page Code Monkey logo

Comments (8)

JanKaul avatar JanKaul commented on May 28, 2024 1

I haven't implemented the aws glue catalog, so you might need to implement it yourself.

If you have the catalog writing looks something like this:

        use iceberg_rust::arrow::write_parquet_partitioned;
        
        // Get table from catalog
        let tabular = catalog.load_table(Identifier::parse("my_catalog.my_schema.my_table")?);
        
        // Make sure its a table and not a view
        let table = if let Tabular::Table(table) = &tabular {
            Ok(table)
        } else {
            Err(Error::InvalidFormat("database entity is not a table".to_string()))
        }?;
        
        // Write arrow batches to object_store
        let metadata_files =
            write_parquet_partitioned(table, arrow_batches, None)
                .await?;
                
        // Create table transaction
        table
            .new_transaction(None)
            .append(metadata_files)
            .commit()
            .await?;

from iceberg-rust.

JanKaul avatar JanKaul commented on May 28, 2024 1

If you want to read iceberg tables with polars, this crate is not the best option for you. It's not able to do partition pruning with polars and always has to do a full table scan. The apache repo is working on an expression system that will make this possible.

However, if you use this crate with datafusion it performs partition pruning.

from iceberg-rust.

JanKaul avatar JanKaul commented on May 28, 2024

Hey, the crate supports inserting but no updates because it can't handle deletes. The best way to insert is with datafusion.

Check out this test:

pub async fn test_datafusion_table_insert() {

Do you want to use it with datafusion or as a rust library?

from iceberg-rust.

ForeverAngry avatar ForeverAngry commented on May 28, 2024

Hi! Well I'll have to do some reading on datafusion. I'm not familiar with it. But I was hoping to use it in rust, with a polars code base I have.

from iceberg-rust.

JanKaul avatar JanKaul commented on May 28, 2024

For now, you can have a look at the following method:

async fn write_all(

I will try to simplify the writer design for non-datafusion use cases.

from iceberg-rust.

ForeverAngry avatar ForeverAngry commented on May 28, 2024

That would be awesome! Also I'd love to contribute - I've used the Java iceberg writer a bit, but if you had some diagram or pseudo code of the steps to complete a successful transaction (update, merge..erc) id be happy to help!

Also, do you have an example of how I could test the writer with aws glue?

from iceberg-rust.

ForeverAngry avatar ForeverAngry commented on May 28, 2024

I'm open to using datafusion to read the data, the real need I have is just to be able to write partitioned iceberg files using a glue catalog.

from iceberg-rust.

JanKaul avatar JanKaul commented on May 28, 2024

If I have time I'll look into the glue catalog. But it could be a while.

from iceberg-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.