|
1 | 1 | /** |
2 | | - * Arrow Configuration Unit Tests (TDD Phase - Task 6.1) |
| 2 | + * Arrow Configuration Unit Tests |
3 | 3 | * |
4 | 4 | * Tests for Arrow IPC configuration and resource limits. |
5 | 5 | * These tests verify: |
6 | 6 | * 1. Global Arrow configuration parsing |
7 | 7 | * 2. Endpoint-level configuration overrides |
8 | 8 | * 3. Request-level parameter handling |
9 | 9 | * 4. Resource limit enforcement |
10 | | - * |
11 | | - * TDD Status: |
12 | | - * - Some tests related to batch size control are expected to FAIL |
13 | | - * because batch size is currently determined by DuckDB's native chunking, |
14 | | - * not by our config.batchSize parameter. |
15 | | - * - These failing tests document the desired behavior for Task 6.2 |
16 | 10 | */ |
17 | 11 |
|
18 | 12 | #include <catch2/catch_test_macros.hpp> |
@@ -103,21 +97,6 @@ TEST_CASE("Arrow Configuration Defaults", "[arrow][config][defaults]") { |
103 | 97 | } |
104 | 98 |
|
105 | 99 | TEST_CASE("Arrow Configuration Custom Values", "[arrow][config][custom]") { |
106 | | - SECTION("Custom batch size is respected") { |
107 | | - DuckDBConfigFixture fixture; |
108 | | - fixture.executeQuery("SELECT i FROM range(1000) t(i)"); |
109 | | - |
110 | | - ArrowSerializerConfig config; |
111 | | - config.batchSize = 100; |
112 | | - |
113 | | - auto arrowResult = serializeToArrowIPC(fixture.result, config); |
114 | | - |
115 | | - REQUIRE(arrowResult.success); |
116 | | - REQUIRE(arrowResult.rowCount == 1000); |
117 | | - // With 1000 rows and batch size of 100, we should have ~10 batches |
118 | | - REQUIRE(arrowResult.batchCount >= 10); |
119 | | - } |
120 | | - |
121 | 100 | SECTION("Custom codec is applied") { |
122 | 101 | DuckDBConfigFixture fixture; |
123 | 102 | fixture.executeQuery("SELECT i FROM range(100) t(i)"); |
@@ -245,52 +224,6 @@ TEST_CASE("Arrow Memory Limits", "[arrow][config][limits][memory]") { |
245 | 224 | } |
246 | 225 | } |
247 | 226 |
|
248 | | -TEST_CASE("Arrow Batch Size Configuration", "[arrow][config][batch]") { |
249 | | - DuckDBConfigFixture fixture; |
250 | | - |
251 | | - SECTION("Small batch size creates more batches") { |
252 | | - fixture.createLargeData(10000); |
253 | | - |
254 | | - ArrowSerializerConfig config; |
255 | | - config.batchSize = 100; // 100 rows per batch |
256 | | - |
257 | | - auto arrowResult = serializeToArrowIPC(fixture.result, config); |
258 | | - |
259 | | - REQUIRE(arrowResult.success); |
260 | | - REQUIRE(arrowResult.rowCount == 10000); |
261 | | - // Should have at least 100 batches (10000 / 100) |
262 | | - REQUIRE(arrowResult.batchCount >= 100); |
263 | | - } |
264 | | - |
265 | | - SECTION("Large batch size creates fewer batches") { |
266 | | - fixture.createLargeData(10000); |
267 | | - |
268 | | - ArrowSerializerConfig config; |
269 | | - config.batchSize = 50000; // Larger than data set |
270 | | - |
271 | | - auto arrowResult = serializeToArrowIPC(fixture.result, config); |
272 | | - |
273 | | - REQUIRE(arrowResult.success); |
274 | | - REQUIRE(arrowResult.rowCount == 10000); |
275 | | - // Should have just 1 batch |
276 | | - REQUIRE(arrowResult.batchCount == 1); |
277 | | - } |
278 | | - |
279 | | - SECTION("Default batch size is reasonable") { |
280 | | - fixture.createLargeData(50000); |
281 | | - |
282 | | - ArrowSerializerConfig config; // Default batch size |
283 | | - |
284 | | - auto arrowResult = serializeToArrowIPC(fixture.result, config); |
285 | | - |
286 | | - REQUIRE(arrowResult.success); |
287 | | - REQUIRE(arrowResult.rowCount == 50000); |
288 | | - // With default batch size of 8192, should have ~6 batches |
289 | | - REQUIRE(arrowResult.batchCount >= 5); |
290 | | - REQUIRE(arrowResult.batchCount <= 10); |
291 | | - } |
292 | | -} |
293 | | - |
294 | 227 | TEST_CASE("Arrow Endpoint Format Configuration", "[arrow][config][endpoint]") { |
295 | 228 | SECTION("Arrow enabled in formats list") { |
296 | 229 | ResponseFormatConfig formatConfig; |
@@ -431,20 +364,6 @@ TEST_CASE("Arrow Configuration Edge Cases", "[arrow][config][edge]") { |
431 | 364 | REQUIRE(arrowResult.rowCount == 0); |
432 | 365 | } |
433 | 366 |
|
434 | | - SECTION("Very small batch size") { |
435 | | - fixture.executeQuery("SELECT i FROM range(10) t(i)"); |
436 | | - |
437 | | - ArrowSerializerConfig config; |
438 | | - config.batchSize = 1; // 1 row per batch |
439 | | - |
440 | | - auto arrowResult = serializeToArrowIPC(fixture.result, config); |
441 | | - |
442 | | - REQUIRE(arrowResult.success); |
443 | | - REQUIRE(arrowResult.rowCount == 10); |
444 | | - // Should have 10 batches (one per row) |
445 | | - REQUIRE(arrowResult.batchCount >= 10); |
446 | | - } |
447 | | - |
448 | 367 | SECTION("Zero batch size uses default") { |
449 | 368 | fixture.executeQuery("SELECT i FROM range(100) t(i)"); |
450 | 369 |
|
|
0 commit comments