Skip to content

Conversation

@dentiny
Copy link
Owner

@dentiny dentiny commented Oct 15, 2025

Summary

Briefly explain what this PR does.

Related Issues

Closes # or links to related issues.

Changes

Checklist

  • Code builds correctly
  • Tests have been added or updated
  • Documentation updated if necessary
  • I have reviewed my own changes

@gemini-code-assist
Copy link

Summary of Changes

Hello @dentiny, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the moonlink project's data storage capabilities by integrating support for Delta Lake tables on S3 and GCS cloud storage. This involves updating the core deltalake library, enabling cloud-specific features, and implementing the necessary logic to configure and manage Delta tables across these diverse storage environments. The changes also include a broad refresh of project dependencies to ensure compatibility and leverage the latest features.

Highlights

  • Delta Lake Storage Options: Introduced support for S3 and GCS storage backends for Delta Lake tables, allowing moonlink to interact with Delta tables hosted on these cloud platforms.
  • Deltalake Crate Update: Upgraded the deltalake Rust crate from version 0.28.1 to 0.29.0, along with enabling deltalake-aws and deltalake-gcp features in Cargo.toml.
  • Dependency Updates: Performed extensive updates to various Rust dependencies in Cargo.lock, including arrow crates (from 55.2.0 to 56.2.0), numerous aws-sdk related crates, and sqlparser. A new aws-sdk-dynamodb package was added, and comfy-table was downgraded.
  • Configurability and Testing: Added utility functions to create Delta Lake table configurations for different storage types and introduced new integration tests to verify basic store and load operations with S3 and GCS.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for S3 and GCS as storage options for Delta Lake tables, which is a great enhancement. The approach of using open_table_with_storage_options and providing storage-specific configurations is correct. However, I've identified a couple of critical issues in the implementation that could lead to panics: one related to parsing local file paths as URLs, and another where error propagation was replaced with .unwrap(). I've also noted some leftover debugging statements that should be removed. Addressing these points will improve the robustness and production-readiness of the code.

println!("storage option = {:?}", storage_options);
println!("location = {:?}", config.location);

let table_uri = Url::parse(&config.location).unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Using Url::parse(&config.location).unwrap() is not safe and will cause a panic for local file paths that are not valid URLs (e.g., /tmp/my_table). This will break tests and functionality for local filesystem storage. You should handle local paths by converting them to file:// URLs. Also, using .unwrap() can lead to unrecoverable panics; it's better to propagate the error using ?.

    let table_uri = if config.location.contains("://") {
        Url::parse(&config.location)?
    } else {
        Url::from_file_path(&config.location).map_err(|()| {
            crate::error::MoonlinkError::Generic {
                msg: format!("Invalid local path for Delta table: {}", config.location),
            }
        })?
    };

Err(_) => {
let arrow_schema = mooncake_table_metadata.schema.as_ref();
let delta_schema_struct = deltalake::kernel::Schema::try_from_arrow(arrow_schema)?;
let delta_schema_struct = deltalake::kernel::Schema::try_from_arrow(arrow_schema).unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The use of .unwrap() here is a regression from the previous error handling with ?. If try_from_arrow fails, this will cause a panic instead of propagating the error. Please revert to using ? or .map_err() to handle the potential error gracefully.

            let delta_schema_struct = deltalake::kernel::Schema::try_from_arrow(arrow_schema)?;

Comment on lines +96 to +97
println!("storage option = {:?}", storage_options);
println!("location = {:?}", config.location);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These println! statements appear to be for debugging purposes. Please remove them before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants