Add format auto-detection for zero-config S3 ingestion#6990
Open
Davidding4718 wants to merge 14 commits into
Open
Add format auto-detection for zero-config S3 ingestion#6990Davidding4718 wants to merge 14 commits into
Davidding4718 wants to merge 14 commits into
Conversation
…ionConfig for settings conversion Signed-off-by: Siqi Ding <dingdd@amazon.com>
Remove the SERIALIZER_OBJECT_MAPPER CoercionConfig that globally coerced empty strings to null across all fields. The targeted VALUE_STRING check in the deserializer already handles bare YAML keys (e.g. stdout:) by treating empty string as null only at the plugin name level. Signed-off-by: Siqi Ding <dingdd@amazon.com>
…Ingestion Add standalone format detection module that identifies compression and data format from raw S3 object bytes. Supports: - Compression: gzip, zstd, snappy (magic byte detection) - Binary formats: Parquet, Avro, ORC, PDF, images (magic bytes) - Text formats: JSON arrays, ND-JSON, CSV, TSV, XML, plain text - Single JSON objects map to NDJSON (json codec only handles arrays) Includes 54 unit tests covering detection logic, edge cases, gzip decompression integration, and file-based end-to-end tests. Signed-off-by: Siqi Ding <dingdd@amazon.com>
…Ingestion Add standalone format detection module that identifies compression and data format from raw S3 object bytes. Supports: - Compression: gzip, zstd, snappy (magic byte detection) - Binary formats: Parquet, Avro, ORC, PDF, images (magic bytes) - Text formats: JSON arrays, ND-JSON, CSV, TSV, XML, plain text - Single JSON objects map to NDJSON (json codec only handles arrays) Includes 54 unit tests covering detection logic, edge cases, gzip decompression integration, and file-based end-to-end tests. Signed-off-by: Siqi Ding <dingdd@amazon.com>
…nd SQS pipeline testing - Add snappy decompression support (both framed and stream formats) - Fix binary garbage detection: non-printable content returns UNKNOWN instead of TEXT - Fix UTF-8 BOM handling: strip BOM before text format detection - Fix CSV quoted field detection: count delimiters outside quotes - Fix NDJSON codec mapping: use 'ndjson' codec for proper JSON field parsing - Add DetectionMetrics class for format distribution dashboard logging - Add comprehensive test data (edge cases, compressed files, ambiguous formats) - Add SQS event-driven pipeline config for iterative testing - Add FormatDetectorPipelineSimulator and FormatDetectorRunner CLI tools - Add FormatDetectorIntegrationTest for custom file/directory testing - Wire AutoDetectS3ObjectWorker into S3 source (codec optional) Signed-off-by: Siqi Ding <dingdd@amazon.com>
…oad testing
Key changes:
- Add Micrometer/PluginMetrics integration for CloudWatch metrics publishing
- Combined format+compression metric names (e.g., csv.snappy, ndjson.gzip)
- Per-type detection duration timers for cost visibility
- Move per-file detection logs to DEBUG level (reduce noise at scale)
- Periodic summary logging (every 60s, only on new activity)
- Add snappy decompression (both framed and stream formats)
- Fix binary content detection (non-printable → UNKNOWN, not TEXT)
- Fix truncated JSON array detection (starts with [{ → JSON MEDIUM)
- Add PDF detection test and proper error messaging
- Add edge case test files (real Parquet, headerless CSV, corrupted gzip, PDF)
- Add Python data generator for load testing (5000+ files)
- Add SQS event-driven pipeline config for iterative testing
- Add OpenSearch sink pipeline config
Load test results: 5000 files detected in 5.6s total (1.1ms avg per file)
Signed-off-by: Siqi Ding <dingdd@amazon.com>
…, remove test data - Revert ProcessingPath routing (PDF/DOCX not supported by OSI yet) - PDF and IMAGE still detected but treated as unsupported (skipped) - Remove DOCX/PPTX detection (not needed until Docling integration) - Remove test data files, pipeline configs, and load test scripts - Keep: detection metrics improvements, summary logging fix, snappy support - Personal AWS configs and generated test data excluded from PR Signed-off-by: Siqi Ding <dingdd@amazon.com>
Davidding4718
requested review from
KarstenSchnitter,
Zhangxunmt,
dinujoh,
divbok,
dlvenable,
graytaylor0,
kkondaka,
oeyh,
san81,
sb2k16,
srikanthjg and
srikanthpadakanti
as code owners
July 10, 2026 18:24
✅ License Header Check PassedAll newly added files have proper license headers. Great work! 🎉 |
Signed-off-by: Siqi Ding <dingdd@amazon.com>
Signed-off-by: Siqi Ding <dingdd@amazon.com>
Signed-off-by: Siqi Ding <dingdd@amazon.com>
Signed-off-by: Siqi Ding <dingdd@amazon.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.
Description
Add a format auto-detection library for Intelligent Ingestion that automatically identifies data format and compression from raw S3 object bytes, eliminating the need for customers to specify a
codecin their pipeline configuration.Key features:
data-prepper-plugins/format-detection/) with minimal dependencies (snappy-java for decompression)S3 source integration:
codecis specified in pipeline config, the S3 source enters auto-detect modeAutoDetectS3ObjectWorkerreads first 64KB of each object, detects format, and selects the appropriate codec dynamicallyAutoDetectCodecFactorymaps detected format to codec plugin (ndjson, json, csv, parquet, avro, newline)DetectionMetricsemits CloudWatch-compatible metrics via Micrometer with combined format+compression names and per-type duration timersPerformance: Average detection time is 1.1ms per file (tested with 5,000 files). Detection overhead is < 0.1% of total pipeline processing time.
Testing
Unit Tests (57 tests):
End-to-End Pipeline Testing (S3 → auto-detect → OpenSearch):
Tested with real S3 bucket using both S3 scan and SQS event-driven modes, with results indexed into an OpenSearch domain.
.ndjson.ndjson.gz.ndjson.snappy.json(array).csv.csv.gz.csv.snappy.tsv.psv(pipe).parquet.pdf.log(plain text)Load Test (5,000 files, ~500MB):
Mixed Format Test (3,600 files — NDJSON + CSV + JSON + compressed variants):
datapreppernamespaceCloudWatch Metrics & Observability
Format detection emits metrics via Micrometer (Prometheus + CloudWatch compatible):
Per format+compression type:
formatDetection.ndjson/formatDetection.ndjson.gzip/formatDetection.csv.snappy— count + duration per typeformatDetection.total— aggregate countformatDetection.failed— unsupported/unknown filesformatDetection.confidence.high/medium/low— confidence breakdownformatDetection.duration— overall detection timerPrometheus endpoint sample (after 5,000 file load test):
Periodic log summary (every 60 seconds during activity, with final summary when ingestion stops):
Issues Resolved
N/A
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.