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

feat: add new enum for compression setting #1

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

Johanneshn
Copy link
Collaborator

Introduce a new enum to the public API, allowing consumers to use it instead of relying on internal dependencies (ParquetSharp)

Before

using DeltaLake;
using ParquetSharp;

.... 

table = new DeltaTable.Builder()
            .FromTable(table)
            .Add(data, options => { options.Compression = Compression.Brotli; })
            .Build();

After

using DeltaLake;

.... 

table = new DeltaTable.Builder()
            .FromTable(table)
            .Add(data, options => { options.Compression = DeltaCompression.Brotli; })
            .Build();

Not sure about the naming, DeltaCompression. Didn't go with Compression just to avoid confusion and collisions

Introduce a new enum to the public API, allowing consumers to use it instead of relying on internal dependencies.
@@ -337,9 +337,12 @@ public Builder Add(IEnumerable<RecordBatch> data, Action<AddOptions>? configure
using var options = new AddOptions();
configure?.Invoke(options);
using var arrowProperties = options.ArrowProperties.Build();

Compression compression = options.Compression.ToParquetSharpCompression();
options.ParquetProperties.Compression(compression);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could not see that compression from the action func where actually used here, so added this.
Perhaps I'm missing something

Copy link
Owner

Choose a reason for hiding this comment

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

Nice catch :D

@johnsusi johnsusi merged commit 4dfeda4 into johnsusi:main Apr 23, 2024
2 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.

None yet

2 participants