Skip to content

refactor(arrow): rename Record to RecordBatch and add deprecated alias#466

Merged
zeroshade merged 4 commits into
apache:mainfrom
Mandukhai-Alimaa:alias-record-to-recordbatch
Aug 13, 2025
Merged

refactor(arrow): rename Record to RecordBatch and add deprecated alias#466
zeroshade merged 4 commits into
apache:mainfrom
Mandukhai-Alimaa:alias-record-to-recordbatch

Conversation

@Mandukhai-Alimaa

Copy link
Copy Markdown
Contributor

Rationale for this change

Rename the Record interface to RecordBatch for clarity, since Record commonly means a single row but this type represents a batch of rows.

What changes are included in this PR?

  • Renamed the Record interface to RecordBatch in /arrow/record.go
  • Updated interface method signatures to use RecordBatch in return types (SetColumn and NewSlice)
  • Added a deprecated type alias type Record = RecordBatch for backward compatibility to avoid breaking existing
    code and ease migration
  • Added proper Go deprecation annotation (// Deprecated:) to ensure tooling support

Are these changes tested?

All existing tests in ./arrow and ./arrow/array packages are passing.

Are there any user-facing changes?

Users can now use the semantically correct RecordBatch type name.

Rename the Record interface to RecordBatch for clarity, since Record
commonly means a single row but this type represents a batch of rows.

Add a deprecated type alias  for backward compatibility
to avoid breaking existing code and ease migration.

Closes: apache#457

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At a minimum we should update the examples to also use RecordBatch instead of Record. We can then incrementally update the rest of the library as we go

@Mandukhai-Alimaa

Copy link
Copy Markdown
Contributor Author

@zeroshade. I updated the examples to use RecordBatch instead of Record.

For the incremental update, we can start with the non-critical leaf packages like internal utilities and specialized features and work our way up to the core packages like array and ipc. We can allow 3-4 days between each update to make sure previous changes did not break anything before moving to the next packages. Let me know what you think. Thanks

Comment thread arrow/record.go Outdated
Comment on lines +51 to +53
// Deprecated: Record is deprecated, use RecordBatch instead.
// Record represents a single row, but this type actually represents a batch of rows.
// This alias is provided for backwards compatibility.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the convention for Go would be for the deprecated notice to be at the bottom. i.e.

Suggested change
// Deprecated: Record is deprecated, use RecordBatch instead.
// Record represents a single row, but this type actually represents a batch of rows.
// This alias is provided for backwards compatibility.
// Record as a term typically refers to a single row, but this type represents a batch of rows, known in Arrow parlance
// as a RecordBatch. This alias is provided for backwards compatibility.
//
// Deprecated: This is deprecated to avoid the confusion of the terminology where Record refers to a single row,
// use [RecordBatch] instead.

@Mandukhai-Alimaa Mandukhai-Alimaa marked this pull request as ready for review August 13, 2025 15:57
@Mandukhai-Alimaa Mandukhai-Alimaa requested a review from kou as a code owner August 13, 2025 15:57
@zeroshade zeroshade merged commit 4c418e4 into apache:main Aug 13, 2025
23 checks passed
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