Skip to content

feat(java): introduce update in transaction#4408

Merged
jackye1995 merged 3 commits intolance-format:mainfrom
fangbo:update-transaction
Aug 12, 2025
Merged

feat(java): introduce update in transaction#4408
jackye1995 merged 3 commits intolance-format:mainfrom
fangbo:update-transaction

Conversation

@fangbo
Copy link
Copy Markdown
Contributor

@fangbo fangbo commented Aug 8, 2025

Issue: #4332

@github-actions github-actions Bot added enhancement New feature or request java labels Aug 8, 2025
@fangbo fangbo force-pushed the update-transaction branch from 3d03943 to 1a0a277 Compare August 8, 2025 06:11
Copy link
Copy Markdown
Contributor

@majin1102 majin1102 left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution. I left some comments.

Please take a look

public static class Builder {
private List<Long> removedFragmentIds = Collections.emptyList();
private List<FragmentMetadata> updatedFragments = Collections.emptyList();
private List<FragmentMetadata> newFragments = Collections.emptyList();
Copy link
Copy Markdown
Contributor

@majin1102 majin1102 Aug 8, 2025

Choose a reason for hiding this comment

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

I wonder why leave them not adapted:

        /// The fields that have been modified
        fields_modified: Vec<u32>,
        /// The MemWAL (pre-image) that should be marked as flushed after this transaction
        mem_wal_to_flush: Option<MemWal>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wonder why leave them:

        /// The fields that have been modified
        fields_modified: Vec<u32>,
        /// The MemWAL (pre-image) that should be marked as flushed after this transaction
        mem_wal_to_flush: Option<MemWal>,

At https://github.com/lancedb/lance/blob/main/rust/lance/src/dataset/write/update.rs#L437 , these two properties is not setted.

Copy link
Copy Markdown
Contributor

@majin1102 majin1102 Aug 8, 2025

Choose a reason for hiding this comment

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

Yeah, I see

I encountered some similar situations. I think this could be challenged for the unalignment with rust format. Maybe we should adapt them and don't use them in that case neither.

What do you think @jackye1995

Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 Aug 8, 2025

Choose a reason for hiding this comment

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

mem_wal_to_flush we can ignore those for now, WAL is WIP feature.

fields_modified I think we have that for future proof, for example add a new column while upserting, but that is also not implement for now.

As long as we use a builder style, we could be able to add those new fields in the future.

config_upsert_values,
}
}
"Update" => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to implement read transaction path as well(convert_to_java_operation)

@fangbo fangbo force-pushed the update-transaction branch from 7835ee0 to 0e561dc Compare August 11, 2025 06:17
Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

Looks good to me, pending rebase

Comment thread java/core/lance-jni/Cargo.lock
@fangbo fangbo force-pushed the update-transaction branch from 237b063 to c2334ce Compare August 12, 2025 02:29
@fangbo
Copy link
Copy Markdown
Contributor Author

fangbo commented Aug 12, 2025

Looks good to me, pending rebase

Thanks very much . The PR has already been rebased.

@jackye1995 jackye1995 merged commit 6b8e240 into lance-format:main Aug 12, 2025
7 checks passed
@fangbo fangbo deleted the update-transaction branch August 12, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants