Commit 6e290f8
committed
Type the lazy __index__ consistently with the in-memory writer
writeDuckDBTableParquet()/buildTableSelectSQL() emitted the __index__ column as
an uncast (offset + row_number()), i.e. always BIGINT, while the in-memory
writer narrows the index (or widens it via index_max). So the same resource got
a different __index__ type depending on which path wrote it, and a cross-path
append (in-memory int32 part 0 + lazy BIGINT part 1) produced a
schema-inconsistent, unreadable resource.
The lazy path now chooses the index integer type up front and CASTs it in SQL,
matching the in-memory writer: narrow by range on a fresh write, honor index_max
when supplied, and pin to part 0's on-disk type on append (read via
readParquetSchema). index_max is threaded through the existing ... to
writeDuckDBTableParquet; row count is already computed on this path, so there is
no extra scan. Adds a .duckdbIntTypeName() Arrow->DuckDB type-name helper.
Tests cover lazy narrowing, index_max = Inf -> int64, and append pinning to
part 0. No behavior change for readers; small resources now narrow on the lazy
path as they already did in-memory (BIGINT -> smallest int).
Bump version to 0.99.5; update NEWS.1 parent 97bbf8c commit 6e290f8
5 files changed
Lines changed: 97 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
1 | 15 | | |
2 | 16 | | |
3 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
423 | 437 | | |
424 | 438 | | |
425 | 439 | | |
426 | 440 | | |
427 | | - | |
| 441 | + | |
428 | 442 | | |
429 | 443 | | |
430 | 444 | | |
| |||
438 | 452 | | |
439 | 453 | | |
440 | 454 | | |
441 | | - | |
442 | | - | |
443 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
444 | 460 | | |
445 | 461 | | |
446 | 462 | | |
| |||
501 | 517 | | |
502 | 518 | | |
503 | 519 | | |
504 | | - | |
| 520 | + | |
505 | 521 | | |
506 | 522 | | |
507 | 523 | | |
| |||
513 | 529 | | |
514 | 530 | | |
515 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
516 | 547 | | |
517 | 548 | | |
518 | | - | |
| 549 | + | |
519 | 550 | | |
520 | 551 | | |
521 | 552 | | |
| |||
530 | 561 | | |
531 | 562 | | |
532 | 563 | | |
533 | | - | |
534 | 564 | | |
535 | 565 | | |
536 | 566 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
0 commit comments