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

Manage Writer resource to be consistent with Snowflake Loader #365

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

istreeter
Copy link
Contributor

BigQuery Loader (v2 branch) and Snowflake Loader are similar applications, in that they both open a channel to the warehouse which must be closed / re-opened whenever the table is altered.

This commit brings to the BigQuery loader all the nice patterns that we figured out in the Snowflake Loader.

  • A Writer[F] is a trait with a single method write, which writes events into the warehouse
  • A Writer.Builder[F] is a trait with a single method open, which opens a Writer.
  • A concrete implementation of Writer.Builder[F] is provided as a wrapper around the BigQuery SDK's Writer
  • The Environment class holds a Coldswap[F, Writer[F]], wherein the ColdSwap has methods for opening / closing the Writer.
  • The Coldswap[F, Writer[F]] is initialized as a wrapper around any Writer.Builder[F].
  • A WriterProviderSpec has the unit tests to validate the implementation of Coldswap[F, Writer[F]]

import WriterProviderSpec._

def is = s2"""
The channel provider should
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: channel?? 😁

BigQuery Loader (v2 branch) and Snowflake Loader are similar applications, in that they both open a channel to the warehouse which must be closed / re-opened whenever the table is altered.

This commit brings to the BigQuery loader all the nice patterns that we figured out in the Snowflake Loader.

- A Writer[F] is a trait with a single method write, which writes events into the warehouse
- A Writer.Builder[F] is a trait with a single method open, which opens a Writer.
- A concrete implementation of Writer.Builder[F] is provided as a wrapper around the BigQuery SDK's Writer
- The Environment class holds a Coldswap[F, Writer[F]], wherein the ColdSwap has methods for opening / closing the Writer.
- The Coldswap[F, Writer[F]] is initialized as a wrapper around any Writer.Builder[F].
- A WriterProviderSpec has the unit tests to validate the implementation of Coldswap[F, Writer[F]]
@istreeter istreeter merged commit 79b94dc into v2 Feb 14, 2024
2 checks passed
@istreeter istreeter deleted the channel-provider branch February 14, 2024 15:36
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