Skip to content

Conversation

@fangbo
Copy link
Contributor

@fangbo fangbo commented Dec 17, 2025

Problem Description

The java method Fragment.mergeColumns returns a LanceSchema.

The java LanceField is converted from a rust lance Field. If a field is a vector which arrow type is FixedSizeList with element's type is Float, the java LanceField missed the element's type when converted from rust. But the Merge transaction needs a arrow Schema. So, when java LanceSchema is converted to arrow Schema a error occurs.

For vector field, the FixedSizeList's element type is only contained in logicalType. This PR use the logicalType to correctly build a arrow Field when converting java LanceSchema to arrow Schema.

@westonpace @jackye1995 @majin1102 Could you give some suggestion about this modification? Thank you very much.

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions github-actions bot added bug Something isn't working java labels Dec 17, 2025
Copy link
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.

Provide some context, please take a look

private final int parentId;
private final String name;
private final boolean nullable;
private final String logicalType;
Copy link
Contributor

Choose a reason for hiding this comment

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

#4207 (comment)

Just a little context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For lance vector data type, only the logicalType has FixedSizeList's element type, such as fixed_size_list:float:3.

So, when LanceField is converted to arrow Field , the FixedSizeList's children should be constructed from logicalType.

@fangbo
Copy link
Contributor Author

fangbo commented Dec 17, 2025

Provide some context, please take a look

Thanks for your comment.

When Lance Schema(Rust) is converted to LanceSchema(Java) and then LanceSchema(java) is converted to Arrow's Schema using LanceSchema.asArrowSchema the FixedSizeList's children is missed.

The original issue is lance-format/lance-spark#138 and related PR is #5471

@fangbo fangbo changed the title fix: support FixedSizeList for java LanceField fix(java): support FixedSizeList for java LanceField Dec 18, 2025
@fangbo fangbo force-pushed the lance-schema branch 4 times, most recently from 6d80731 to d033bad Compare December 22, 2025 02:18
@fangbo
Copy link
Contributor Author

fangbo commented Dec 22, 2025

@westonpace @jackye1995 This PR is ready. I look forward to your feedback. Thank you.

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

Labels

bug Something isn't working java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants