Kafka connect shredding#16369
Closed
soumilshah1995 wants to merge 3 commits into
Closed
Conversation
This commit adds automatic variant shredding support for Kafka Connect and other tools using generic Record types. Variant shredding optimizes Parquet storage by extracting frequently-occurring fields from variant data into typed columns for better compression and query performance. Key Changes: - Add RecordVariantShreddingAnalyzer for generic Record types - Update GenericFormatModels to enable variant shredding with buffering - Add comprehensive documentation for configuration and usage Implementation Details: - Buffers first N rows (default: 100) for schema analysis - Automatically selects fields appearing in ≥10% of rows - Limits shredding to 300 fields and 50 nesting levels - Uses GenericRecord::copy for safe row buffering Configuration: - Enable: write.parquet.shred-variants=true - Buffer size: write.parquet.variant-inference-buffer-size=100 Benefits: - Better Parquet compression through typed columns - Faster queries with predicate pushdown - Lower storage costs - Zero code changes required in Kafka Connect Memory Considerations: - Memory usage: buffer_size × concurrent_writers × row_size - Recommended: Keep buffer small (100-500) for production - Increase target file size to reduce concurrent writers Limitations: - No explicit field control (automatic selection only) - Per-file analysis (schemas may vary across files) - Requires buffering (adds latency for first N rows) Future Enhancements: - Schema hints for zero-buffering production deployments - Global sampling with schema caching - Field whitelisting/blacklisting See KAFKA_CONNECT_VARIANT_SHREDDING.md for detailed documentation. Co-authored-by: Cursor <cursoragent@cursor.com>
Register RecordVariantShreddingAnalyzer and Record::copy on the generic Parquet format model, and resolve VARIANT column indices from Iceberg schema order so analysis works with Void engine schemas (Connect path). Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.