Skip to content

GH-43443: [Go] [IPC] Infer schema from first record if not specified#43484

Merged
joellubi merged 1 commit intoapache:mainfrom
joellubi:gh-43443
Jul 31, 2024
Merged

GH-43443: [Go] [IPC] Infer schema from first record if not specified#43484
joellubi merged 1 commit intoapache:mainfrom
joellubi:gh-43443

Conversation

@joellubi
Copy link
Copy Markdown
Member

@joellubi joellubi commented Jul 30, 2024

Rationale for this change

Fixes: #43443

Makes usage of the IPC writer and any writers that use it such the flight writer simpler.

What changes are included in this PR?

  • Infer schema from first record if schema is not specified
  • IPC and Flight tests

Are these changes tested?

Yes

Are there any user-facing changes?

Any ipc.Writer that does not specify the optional argument ipc.WithSchema will no longer return an error as long as the incoming stream of records has a consistent schema.

@github-actions
Copy link
Copy Markdown

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

@joellubi joellubi marked this pull request as ready for review July 30, 2024 11:56
@joellubi joellubi requested a review from zeroshade as a code owner July 30, 2024 11:56
Copy link
Copy Markdown
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

LGTM just one nit that may not be applicable

fs := flightStreamWriter{}
w := flight.NewRecordWriter(&fs, ipc.WithSchema(schema))

require.ErrorContains(t, w.Write(recs[0]), "arrow/ipc: tried to write record batch with different schema")
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.

do we use a specific error type via %w in this message? If so, can we try using ErrorIs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We don't unfortunately. The definition is currently just an errString.

@github-actions github-actions bot added awaiting merge Awaiting merge awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review awaiting merge Awaiting merge labels Jul 30, 2024
@joellubi joellubi merged commit e9f6667 into apache:main Jul 31, 2024
@joellubi joellubi removed the awaiting changes Awaiting changes label Jul 31, 2024
@conbench-apache-arrow
Copy link
Copy Markdown

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

There were 11 benchmark results indicating a performance regression:

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

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.

The flight.NewRecordWriter parameter is ambiguous

2 participants