Why do MSQE Sql based ingestion limits to 25,000 p...
# troubleshooting
m
Why do MSQE Sql based ingestion limits to 25,000 partitions? i.e. if I want to ingest a huge table and have good segment size, then the above limit fails the job
j
The 25K limit is for stability and performance reasons predominantly. You do not want to have a lot of (small) segments that it becomes unwieldy to manage. Not knowing your requirements and implementations, you can consider using coarser granularity and then adjusting targetRowsPerSegment value (5M to 8M ideally) via context parameter, as an option.
k
It was mainly as a safety valve. The work around is to break up your job. We can think of increasing that limit as well. Do you have a limit in mind which will unblock your use case ?
k
Also calling out that the number of segments within a single interval is limited to
Short.MAX_VALUE
i.e. ~32k.
m
The limit seems to be across all interval though (all segments across all interval must be < 25,000)
I encountered this issue while migrating some native batch ingestion jobs (using ingestionSpec) to SQL-based ingestion. Some of these jobs process data spanning five years, with approximately 4,000,000,000 rows (post-rollup) per month. At 5,000,000 rows per segment, this results in around 48,000 segments—well above the 25,000 segment limit. These jobs are designed to replace / overwrite the entire datasource. Increasing the number of rows per segment introduces two problems: 1. Out-of-Memory Errors: Sometimes, increasing the segment size causes the job to fail with errors like
UnknownError: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.OutOfMemoryError: Cannot reserve 65536 bytes of direct buffer memory (allocated: 3221189932, limit: 3221225472).
2. Degraded Query Performance: Larger segments reduce parallelism, which negatively impacts query performance compared to the previous approach, where smaller segments were possible with native batch ingestion.
k
Is it easy enough for you to bump the limit to 50 K and try to check if things hold, mostly the overlord , the coordinator balancing and the controller heap usage ?