Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-39720: [Swift] Switch reader to use arrow field instead of proto for building arrays #39721

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

abandy
Copy link
Contributor

@abandy abandy commented Jan 21, 2024

This PR updates the ArrowReaderHelper to use an ArrowField object for building an Array instead of a protobuf field obj. This removes leveraging protobuf from building out the Arrays and makes the code easier to reuse (like for the C Data Interface)

@abandy abandy requested a review from kou as a code owner January 21, 2024 01:30
@abandy abandy changed the title MINOR:switch reader to use arrow field instead of proto for building arrays GH-39720:switch reader to use arrow field instead of proto for building arrays Jan 21, 2024
@github-actions github-actions bot added the awaiting review Awaiting review label Jan 21, 2024
@abandy abandy changed the title GH-39720:switch reader to use arrow field instead of proto for building arrays GH-39720: [SWIFT] switch reader to use arrow field instead of proto for building arrays Jan 21, 2024
Copy link

⚠️ GitHub issue #39720 has been automatically assigned in GitHub to PR creator.

@abandy abandy changed the title GH-39720: [SWIFT] switch reader to use arrow field instead of proto for building arrays GH-39720: [Swift] switch reader to use arrow field instead of proto for building arrays Jan 21, 2024
@abandy abandy force-pushed the GH-39720 branch 2 times, most recently from d95dbdf to 718e1c1 Compare January 21, 2024 01:47
@@ -165,6 +167,48 @@ public class ArrowType {
return ArrowType.ArrowUnknown
}
}

public static func getStride( // swiftlint:disable:this cyclomatic_complexity
Copy link
Member

Choose a reason for hiding this comment

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

How about making this a normal func (instance method) not a static func?

nullCount: nullCount, stride: MemoryLayout<Int8>.stride)
let arrowType = ArrowType(ArrowType.ArrowBinary)
let arrowData = try ArrowData(arrowType, buffers: buffers,
nullCount: nullCount, stride: ArrowType.getStride(arrowType))
Copy link
Member

Choose a reason for hiding this comment

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

How about computing stride: in ArrowData.init() because ArrowData.init() can use the given ArrowType?

@github-actions github-actions bot added awaiting review Awaiting review awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Jan 22, 2024
@github-actions github-actions bot added awaiting review Awaiting review and removed awaiting review Awaiting review awaiting changes Awaiting changes labels Jan 23, 2024
@abandy
Copy link
Contributor Author

abandy commented Jan 27, 2024

@kou I hope all is well. Please review again when you get a chance.

@kou kou changed the title GH-39720: [Swift] switch reader to use arrow field instead of proto for building arrays GH-39720: [Swift] Switch reader to use arrow field instead of proto for building arrays Jan 27, 2024
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@kou kou merged commit 21ffd82 into apache:main Jan 27, 2024
8 checks passed
@kou kou removed the awaiting review Awaiting review label Jan 27, 2024
@github-actions github-actions bot added the awaiting merge Awaiting merge label Jan 27, 2024
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 21ffd82.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 35 possible false positives for unstable benchmarks that are known to sometimes produce them.

dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…roto for building arrays (apache#39721)

This PR updates the ArrowReaderHelper to use an ArrowField object for building an Array instead of a protobuf field obj.  This removes leveraging protobuf from building out the Arrays and makes the code easier to reuse (like for the C Data Interface)
* Closes: apache#39720

Authored-by: Alva Bandy <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Feb 28, 2024
…roto for building arrays (apache#39721)

This PR updates the ArrowReaderHelper to use an ArrowField object for building an Array instead of a protobuf field obj.  This removes leveraging protobuf from building out the Arrays and makes the code easier to reuse (like for the C Data Interface)
* Closes: apache#39720

Authored-by: Alva Bandy <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Mar 8, 2024
…roto for building arrays (apache#39721)

This PR updates the ArrowReaderHelper to use an ArrowField object for building an Array instead of a protobuf field obj.  This removes leveraging protobuf from building out the Arrays and makes the code easier to reuse (like for the C Data Interface)
* Closes: apache#39720

Authored-by: Alva Bandy <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Swift] Change reader helper to use ArrowField instead of protobuf field obj for making and Array
2 participants