Skip to content

[Fix][Connector-V2] Create Lance BIGINT columns as int64 - #13061

Merged
davidzollo merged 4 commits into
apache:devfrom
SEPURI-SAI-KRISHNA:fix-lance-bigint-int64
Nov 9, 2026
Merged

davidzollo merged 4 commits into
apache:devfrom
SEPURI-SAI-KRISHNA:fix-lance-bigint-int64

Conversation

@SEPURI-SAI-KRISHNA

@SEPURI-SAI-KRISHNA SEPURI-SAI-KRISHNA commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Yes, glad to contribute to Apache SeaTunnel.

Purpose of this pull request

Closes #13057.

When the Lance sink created a dataset, SchemaUtils.convertSchema declared BIGINT columns as Arrow int32, and IntTypeWriter wrote them with Number.intValue(). Any value outside the signed 32-bit range was wrapped without an error: 3000000000 was stored as -1294967296, and the epoch millisecond 1739586083123 as 124328243. LanceTypeMapper.convertJsonArrowType, used by the catalog's createTable, had the same int32 mapping.

The fix. Both mappings now declare BIGINT as int64. The writer already handles 64-bit columns (IntTypeWriter writes them with longValue()), and the catalog already turns int64 into Int(64), so no writer change is needed.

LanceCatalog.getTable now reads such a column back as BIGINT. The directory namespace returns no schema, so getTable converts the dataset's own Arrow schema with convertArrowSchemaToJsonArrowSchema, which labelled every integer column int32. It now labels a 64-bit column int64 (uint64 when unsigned), and LanceTypeMapper.convertDataType maps int64 to BIGINT. The narrower and unsigned integer types still read as INT, as before.

Unchanged: TINYINT, SMALLINT and INT stay int32, and every option stays the same.

Not covered, on purpose:

  • A dataset created by an earlier version keeps its int32 column, because the sink writes to the schema of a dataset that already exists (LanceSinkWriter.initializeDataset). Large values written there still wrap. The documentation and the upgrade note say so. If maintainers prefer, a follow-up can make a write to an int32 column fail when the value does not fit, instead of wrapping it.

Does this PR introduce any user facing change?

Yes. A dataset the Lance sink creates now has an int64 column for BIGINT, where it had int32, and large values are stored correctly. The type mapping table and its note in the en and zh sink documentation are updated, and the change is recorded in incompatible-changes.md in en and zh.

How was this patch tested?

Unit tests, two new cases in the existing FragmentConverterTest and two new assertions in LanceCatalogTest:

  • shouldKeepEveryBitOfABigint: the schema SchemaUtils.convertSchema builds when the sink creates the dataset, then FragmentConverter.convertToVectorSchemaRoot with 3000000000, -3000000000, 1739586083123, Long.MAX_VALUE and Long.MIN_VALUE. It asserts the column is Int(64) and every value is stored unchanged.
  • shouldDeclareABigintColumnAsInt64InTheCatalogSchema: SchemaUtils.convertJsonArrowSchema, which the catalog's createTable uses, declares a BIGINT column as int64.
  • LanceCatalogTest.getTable: getTable reads long_col back as BIGINT and integer_col as INT. The existing toString comparison in that test does not see column types, because TableSchema.toString() leaves out the columns.

Mutation check: with SchemaUtils.java and LanceTypeMapper.java reverted to dev, both FragmentConverterTest cases fail, with expected: <Int(64, true)> but was: <Int(32, true)> and expected: <int64> but was: <int32>. Reverting only convertDataType, or only the getTable schema conversion, fails LanceCatalogTest.getTable with expected: <BIGINT> but was: <INT>.

E2E. LanceIT.testBigintKeepsItsValue runs the new fake_bigint_to_lance.conf, which writes four rows with values outside the int32 range, then reads the dataset back in the test JVM and compares every value. A duplicated id fails the read-back. It uses the same read-back as testTimestampKeepsItsMicroseconds, so it fails rather than skips when the dataset cannot be read. On dev the column is int32, so the read-back fails.

Docker is not available to me, so the job itself has not run locally. LanceIT.java compiles, and the new configuration parses.

Build checks, JDK 17:

  • ./mvnw clean test -pl seatunnel-connectors-v2/connector-lance, with the surefire.jvm.args the unit-test CI lane passes: 41 tests, 0 failures.
  • ./mvnw spotless:check on connector-lance and connector-lance-e2e: clean.
  • ./mvnw -B -T 1 clean test -D"license.skipAddThirdParty"=true -pl seatunnel-ci-tools: 34 tests, 0 failures.

Check list

  • Code changed are covered with tests, or it does not need tests for reason
  • If any new Jar binary package adding in your PR, please add License Notice according to
    License Notice: none added.
  • If necessary, please update the documentation to describe the new feature: the Lance sink type mapping is updated in en and zh, and incompatible-changes.md in en and zh.
  • If you are contributing the connector code, please check that the following files are updated:
    1. Update plugin-mapping.properties: not needed, no new connector.
    2. Update the pom file of seatunnel-dist: not needed, no new module.
    3. Add ci label in label-scope-conf: not changed, outside this fix.
    4. Add e2e test for your connector: LanceIT is extended.
    5. Update connector-v2 doc: the Lance sink document is updated.
  • Update the release-note: not applicable, the file was removed from dev in [Improve] Remove release-note.md in dev branch #9304.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I read all nine changed files and traced both implicit dataset creation and catalog creation through Arrow vector writing. No blocking issues found. The source fix, exact-value unit coverage, existing Lance IT extension and explicit old-dataset migration note fit together well; current-head CI remains a separate gate.

What Problem Does This PR Solve?

User pain point: The Lance sink creates BIGINT columns as int32 and silently wraps values outside the signed 32-bit range, including ordinary epoch milliseconds.

Fix approach: Map BIGINT to int64 in both Arrow schema creation and JSON catalog schema conversion, relying on the existing int64 value writer; add exact extreme-value tests and bilingual migration guidance.

One-sentence summary: 3000000000 used to wrap to -1294967296 in a newly created dataset. With an int64 column it stays 3000000000. Existing int32 datasets intentionally require recreation and replay, as documented.

Review report time: 2026-10-29T12:58:12.466075-04:00. Current head c91e4babfb4048c79b274501a63a65dd82f071cf; base dev at 5598ed7f3a88602032a18b617cb21c688aacf965. Checks: Signal pull request update=QUEUED. Check references: Signal pull request update. Compare: ahead, ahead 1, behind 0; merge state blocked / BLOCKED.

1. Code Change Review

1.1 Core Logic Analysis

SchemaUtils.java:69-80 separates BIGINT from TINYINT/SMALLINT/INT and creates signed ArrowType.Int(64). LanceTypeMapper.java:91-106 does the same for catalog JSON int64. LanceSinkWriter.initializeDataset:83-115 opens an existing schema first, or invokes SchemaUtils.convertSchema on creation; flushBatch:134-177 passes that schema into FragmentConverter. FragmentConverter delegates to TypeWriterFactory using actual Arrow width, so int64 reaches Number.longValue while existing int32 remains narrowing. Catalog createTable calls convertJsonArrowSchema -> LanceTypeMapper. All nine changed files, including both guides/incompatible entries, the existing FragmentConverterTest/LanceIT and its new fixture, were inspected.

Before:

case TINYINT: case SMALLINT: case INT: case BIGINT:
  field = Field.nullable(name, new ArrowType.Int(32, true));

After:

case TINYINT: case SMALLINT: case INT: /* int32 unchanged */
case BIGINT: field = Field.nullable(name, new ArrowType.Int(64, true));
// Catalog JSON uses int64 for the same logical type.

Key Findings

  • Normal first-row dataset creation reaches the corrected Arrow mapper.
  • Catalog-created datasets reach the second corrected mapper, preventing a creation-path mismatch.
  • Existing datasets retain their real schema and are explicitly excluded from automatic conversion.
  • Tests check actual BigIntVector values including both long extrema rather than only the schema label.
  • The change is a precise width fix, not repair of already truncated historical rows.

Complete runtime path

LanceSinkFactory -> LanceSink.createWriter -> LanceSinkWriter.write
 -> first row: Dataset.open succeeds -> keep existing schema
 -> otherwise SchemaUtils.convertSchema -> BIGINT Arrow int64 -> Dataset.create
 -> batch -> FragmentConverter.convertToVectorSchemaRoot -> TypeWriterFactory width 64
 -> BigIntVector long values -> fragments -> append transaction commit
Catalog path -> LanceCatalog.createTable -> SchemaUtils.convertJsonArrowSchema
 -> LanceTypeMapper BIGINT int64 -> catalog dataset creation
New IT -> explicit rows -> sink creation/write/close -> host Dataset scanner -> exact ID/value map

The effects depend on the entry and preconditions above. Recovery, batching and connector lifecycle retain their existing contracts unless explicitly described here; source inspection is not runtime proof.

1.2 Compatibility Impact

Partially incompatible. New BIGINT columns are int64 instead of int32; consumers expecting the former wrong width must adapt. Both incompatible-changes pages state that existing datasets are not altered and require recreation/replay to store large values safely. API, options/defaults, connector IDs and checkpoint serialization are unchanged. Previously lost high bits cannot be recovered without rereading the source.

1.3 Performance / Side-Effect Analysis

BIGINT vectors use eight bytes per value instead of four, the required storage width; other integer vectors remain int32. No new executor, locks, retries, network path or resource owner is added. Allocator/vector ownership remains try-with-resources in the tests and existing writer lifecycle in production.

1.4 Error Handling and Logging

Existing dataset open/create/write errors retain their connector context. The change eliminates newly-created-schema narrowing without pretending to validate or migrate an old int32 target. No new sensitive logs or swallowed exceptions are introduced.

No blocking issues found.

2. Code Quality Assessment

2.1 Coding Standards

The complete changed-file set, imports and removed lines were inspected. The new switch branches follow the adjacent mapper style and add no new core method/field. The test helper and fixture reuse existing classes; ASF headers and the existing resource lifecycle are preserved.

2.2 Test Coverage and Test Stability

Stability rating: Stable. FragmentConverterTest.java:296-348 checks fixed out-of-int32 values, Long.MAX_VALUE and Long.MIN_VALUE through the actual declared schema/vector, with deterministic allocator/root closure. LanceIT.java:162-195 waits on scanned committed values using Awaitility and closes allocator/dataset/scanner/reader. The new fixture supplies fixed unique IDs and actual long literals. The existing container lifecycle clears the bind-mounted directory between invocations; no cross-engine residual dataset is assumed as evidence. The map asserts the value regression; a separate total-row assertion could strengthen duplicate detection, which is outside this width fix. No new sleeps, fixed host ports or wall-clock expected values. Runtime/JNI and engine coverage depend on CI; no local execution occurred.

Local verification results: exact-head git fetch and isolated review branch seatunnel-review-13061 created; full git diff 5598ed7f3a88602032a18b617cb21c688aacf965...c91e4babfb4048c79b274501a63a65dd82f071cf read (9 files); git diff --check passed; git show, rg and line-numbered source/caller/config/test reads used for the trace above. GitHub changed filenames are reconciled with this local diff before publication. No local compile, Maven verify, unit/IT/E2E, Docker, service or UI execution occurred, as required for this review task. No build/deployment artifact was reused; engine-ui was not built.

2.3 Documentation Updates

The en/zh Lance mapping and both incompatible-changes entries consistently distinguish new int64 targets, unchanged old int32 targets and replay migration. Numeric wrap examples match signed 32-bit narrowing.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix.

3.2 Maintainability

Best change-location assessment: Correct both schema-declaration boundaries and reuse the existing width-aware value writer. Casting a long to int later or changing source values would mask data loss. A separate explicit old-target migration tool is a larger follow-up; this PR accurately documents its limits.

3.3 Extensibility

Keep existing connector identities and contracts. Reuse the current boundary and regression fixtures; no shared-framework redesign or unrelated dependency is needed for the behavior reviewed here.

3.4 Historical-Version Compatibility

New BIGINT columns are int64 instead of int32; consumers expecting the former wrong width must adapt. Both incompatible-changes pages state that existing datasets are not altered and require recreation/replay to store large values safely. API, options/defaults, connector IDs and checkpoint serialization are unchanged. Previously lost high bits cannot be recovered without rereading the source. This review does not claim an executed upgrade/recovery validation.

4. Issue Summary

Number Issue Location Severity
- No blocking issues found Full changed scope -

Completeness check: full diff and affected entry/call chain, failure/resource paths, compatibility, tests and stability, bilingual docs, configuration/registration and current CI/merge gates were inspected before enumerating these findings. No additional finding is reserved for a later round on this version.

Community review reconciliation: No earlier non-Daniel review or inline/discussion finding was present. There is no existing maintainer approval to attribute to Daniel.

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers — must be fixed: No code-side blocker found. Required current-head CI and effective maintainer review/merge gates must be satisfied.
  2. Recommended fixes — non-blocking: No additional unrelated redesign is requested.

Overall assessment: Correct both schema-declaration boundaries and reuse the existing width-aware value writer. Casting a long to int later or changing source values would mask data loss. A separate explicit old-target migration tool is a larger follow-up; this PR accurately documents its limits. Current head c91e4babfb4048c79b274501a63a65dd82f071cf; base dev at 5598ed7f3a88602032a18b617cb21c688aacf965. Checks: Signal pull request update=QUEUED. Check references: Signal pull request update. Compare: ahead, ahead 1, behind 0; merge state blocked / BLOCKED. Behind/diverged status alone is synchronization metadata and does not justify a sync-and-rerun instruction. Daniel has READ permission: this COMMENT is a technical conclusion, not an effective APPROVED event or dismissal of historical requested changes. A write-capable maintainer owns final approval/dismissal where required. The collected current-head signal is queued and no completed Build is attached. Source clearance is not an effective APPROVED review under Daniel READ permission and is not runtime/JNI acceptance; wait for this head's required checks and a write-capable maintainer. Thanks again; happy to help with the focused next revision.

@DanielLeens

Copy link
Copy Markdown
Contributor

The fork discovery check now establishes a successful Build on this exact head (40897010419), while the PR aggregate has not yet adopted a runtime Build. My source conclusion remains clear. Please have a maintainer reconcile the existing matching run and the final effective approval gate; do not rerun blindly or add a source commit solely to refresh that pointer. This is additional CI evidence, not a claim of local Lance/JNI execution.

Checked 2026-10-29T17:10:40+00:00; head c91e4babfb4048c79b274501a63a65dd82f071cf. Signal pull request update = QUEUED

Verified matching fork evidence: Build run 40897010419, attempt 1, success. Repository aggregate/adoption and effective approval remain separately evaluated.

Comparison: base dev, head c91e4babfb4048c79b274501a63a65dd82f071cf, ahead, ahead 1 / behind 0; GitHub mergeable state blocked. Behind/diverged alone is recorded metadata and does not add a sync request.

Daniel has READ repository permission. This is a discussion/CI clarification, not a new complete source review, an effective APPROVED event or dismissal of historical requested changes. A write-capable maintainer must perform any required final approval/dismissal. Thanks for keeping the follow-up focused.

@DanielLeens

Copy link
Copy Markdown
Contributor

The CI fact cited previously has changed: the aggregate Build has now adopted a successful result for this exact head. The previous aggregate-adoption request is closed; no redundant run or source commit is needed. CI was previously the only remaining technical blocker; CI is now passing, so my technical conclusion is clear to proceed to a write-capable maintainer for effective approval. My READ-permission clarification is not an APPROVED event.

Snapshot 2026-10-30T03:23:54.080172+00:00: head c91e4babfb4048c79b274501a63a65dd82f071cf; Signal pull request update = SUCCESS; Build = SUCCESS.

Base dev; comparison diverged, ahead 1, behind 3; merge state blocked. Behind/diverged alone is recorded metadata and does not add a sync request. This is an unchanged-head discussion/CI clarification, not a new complete source review, an effective approval or a dismissal of historical requested changes.

@DanielLeens

Copy link
Copy Markdown
Contributor

GitHub now reports an actual content conflict (CONFLICTING / DIRTY), superseding the earlier no-conflict snapshot on this unchanged head. Please reconcile the latest base while preserving both this PR's change and the intervening upstream work, then obtain required checks on the resulting commit. This request is based on the conflict, not the number of commits behind. Existing-head CI cannot validate that future resolution.

My prior source conclusion remains clear for the reviewed scope; optional recommendations remain optional. The new conflict and current CI/repository approval gates are separate from that technical conclusion.

Checked 2026-10-31T03:03:23.091263+00:00; unchanged head c91e4babfb4048c79b274501a63a65dd82f071cf. Signal pull request update=SUCCESS; Build=SUCCESS.

This is a discussion/CI clarification, not another full source review or an effective maintainer approval. Daniel has READ repository permission; a write-capable maintainer owns required approval/dismissal.

@chovy-3012

Copy link
Copy Markdown
Contributor

Issue 1 (Medium, non-blocking) — Read path maps int64 to SeaTunnel INT (32-bit)

Location: LanceTypeMapper.java:48-57 (convertDataType)

case "int": case "int8": case "int16": case "int32":
case "int64":   // falls through with every int variant
case "uint8": ... case "uint64":
    return BasicType.INT_TYPE;   // 32-bit, regardless of width

Call chain: LanceCatalog.getTable:160 → convertTableSchema:363 → SchemaUtils.toSeaTunnelType:55 → convertDataType:43. This PR fixes the write direction (BIGINT → int64) but leaves the read direction unchanged, so getTable reports a BIGINT column as INT (32-bit). Before this PR: write=int32 / read=INT — both wrong but width-consistent. After: write=int64 (correct) / read=INT (wrong) — the width mismatch is newly introduced. A downstream sink building DDL from LanceCatalog.getTable would create an INT column and truncate on insert; roundtrip fidelity is also broken (create BIGINT → getTable returns INT → recreate yields int32, reintroducing the truncation this PR fixes). Suggested fix:

case "int64":
case "uint64":
    return BasicType.LONG_TYPE;

Not raised by another reviewer.


Issue 2 (Low, non-blocking) — Fallback converter collapses all ArrowType.Int to "int32"

Location: LanceCatalog.java:449-450 (convertArrowSchemaToJsonArrowSchema)

if (arrowType instanceof org.apache.arrow.vector.types.pojo.ArrowType.Int) {
    jsonType.setType("int32");   // ignores getBitWidth()
}

When describeTable returns an empty schema, getTable (lines 173-186) falls back to the dataset's Arrow schema and runs this converter, which relabels any ArrowType.Int as "int32" regardless of bit width — so an int64 column becomes "int32" before reaching convertDataType. Even after Issue 1 is fixed, this fallback still mislabels int64. convertJsonArrowTypeToArrowType:518-534 already handles every width correctly, so the asymmetry looks like an oversight. Suggested fix:

jsonType.setType(((ArrowType.Int) arrowType).getBitWidth() == 64 ? "int64" : "int32");

Not raised by another reviewer.


Issue 3 (Low, non-blocking) — E2E read-back keyed by id masks duplicate rows

Location: LanceIT.java, new readBigints() method

Map<Integer, Long> values = new HashMap<>();
...
values.put(ids.get(i), bigints.get(i));   // keyed by id; duplicates silently overwrite

If the sink ever duplicates rows (retry / Append misconfig), the Map keeps only the last entry per id, so assertEquals(expected, readBigints()) can still pass. The sibling testInsertAndCheckDataE2e:116 already shows the row-count pattern. Suggested fix: add assertEquals(expected.size(), totalRows) alongside the map equality assertion. Raised by DanielLeens.

# Conflicts:
#	docs/en/introduction/concepts/incompatible-changes.md
#	docs/zh/introduction/concepts/incompatible-changes.md
@SEPURI-SAI-KRISHNA

Copy link
Copy Markdown
Collaborator Author

@chovy-3012 thanks, all three are fixed in the new commit.

  1. convertDataType now maps int64 to BIGINT.
  2. convertArrowSchemaToJsonArrowSchema now labels a 64-bit integer column int64 (uint64 when unsigned). This one matters more than it looks: the directory namespace returns no schema from describeTable, so getTable always goes through this fallback. Fixing only 1 still read the column as INT.
  3. readBigints now fails on a duplicated id.

Coverage: LanceCatalogTest.getTable already creates a long_col BIGINT column, but its toString comparison never saw the column types, because TableSchema.toString() leaves out the columns. It now also asserts long_col reads back as BIGINT and integer_col as INT. Reverting either 1 or 2 alone fails it with expected: <BIGINT> but was: <INT>.

The narrower and unsigned integer types still read as INT, as before; I kept this PR to BIGINT.

@DanielLeens the conflict is resolved by merging dev. Only the two incompatible-changes.md files conflicted; both entries are kept, and the merged change against dev is the same as before.

Checks, JDK 17: connector-lance 41 tests, 0 failures, with the CI surefire.jvm.args; spotless:check clean on connector-lance and connector-lance-e2e. The PR description is updated.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick and thorough follow-up, and for taking @chovy-3012's feedback on board so promptly. I re-read the whole diff at the current head b3cacb0c4e5c4dad4649b5078ffab0bb12847ed1 (not just the increment since my last review at c91e4bab). My previous round had no blockers and the code path is the same, so nothing is outstanding from me. The read-back gaps raised by chovy-3012 (Issues 1 to 3 in that comment) are all resolved in this head, which also closes a gap my earlier review did not look at: the read direction of the type mapping. Sorry I did not trace that side in the first round.

What Problem Does This PR Solve?

User pain point: A dataset created by the Lance sink declared BIGINT as Arrow int32, so values outside the signed 32-bit range (for example 3000000000 or an epoch in milliseconds) were silently wrapped.

Fix approach: Declare BIGINT as int64 in both schema builders (SchemaUtils.convertSchema for implicit dataset creation, LanceTypeMapper.convertJsonArrowType for catalog createTable), and make the read direction width-aware so getTable reports such a column as BIGINT.

One-sentence summary: New Lance datasets keep every bit of a BIGINT, and the catalog round-trips the type; datasets created by older versions are documented as needing recreation.

1. Code Change Review

1.1 Core Logic

Write path (implicit create): LanceSinkWriter.initializeDataset -> SchemaUtils.convertSchema (SchemaUtils.java:69-78, BIGINT now Int(64, true)) -> FragmentConverter.convertToVectorSchemaRoot -> TypeWriterFactory (ArrowType.Int -> IntTypeWriter) -> BigIntVector.setSafe(..., longValue()) (IntTypeWriter.java:53). The writer already handled 64-bit vectors, so no writer change is needed. I confirmed this by reading it.

Write path (catalog): SchemaUtils.convertJsonArrowSchema -> LanceTypeMapper.convertJsonArrowType (LanceTypeMapper.java:96-102, BIGINT -> int64). LanceCatalog already converts int64 to Int(64).

Read path (new in this head): LanceCatalog.getTable -> (directory namespace returns no schema) convertArrowSchemaToJsonArrowSchema (LanceCatalog.java:449-456, 64-bit labelled int64/uint64, others still int32) -> SchemaUtils.toSeaTunnelType -> LanceTypeMapper.convertDataType (LanceTypeMapper.java:48-58, int64 -> LONG_TYPE). I checked all callers (git grep for toSeaTunnelType, convertDataType, convertArrowSchemaToJsonArrowSchema): the only consumer is LanceCatalog (:182, :363), and there is no Lance source connector in this module, so the INT -> BIGINT change on read is contained to the catalog.

1.2 Compatibility: Partially incompatible (intentional, documented)

  • A dataset created by this version has an int64 column where earlier versions created int32. A downstream consumer that hard-codes int32 needs updating. This is called out in the en and zh incompatible-changes.md.
  • Existing datasets keep their int32 column and still wrap, because initializeDataset writes to the existing schema. This is stated in the docs and the PR description, which is the honest and sufficient treatment for this fix. A fail-fast range check on int32 columns is a reasonable follow-up, as the author already suggests.
  • getTable now returns BIGINT instead of INT for a 64-bit column. That is a correction (the old INT was width-wrong), but it is a small visible behaviour change; see Issue 1 (docs only).
  • TINYINT/SMALLINT/INT and all options are unchanged. Unsigned 64-bit still maps to INT on read, exactly as before.

1.3 Performance and Side Effects

None of concern. int64 doubles the per-value width for these columns (4 -> 8 bytes), which is inherent to the correctness fix. No new allocations, loops or hot-path logic.

1.4 Error Handling and Logging

No new error paths. Issues:

Issue 1: The read-back change is not mentioned in the docs

  • Location: docs/en/introduction/concepts/incompatible-changes.md and docs/zh/... (new Lance entry)
  • Problem: The entry describes the create-side change, but LanceCatalog.getTable now also returns BIGINT where it used to return INT for these columns.
  • Risk: Low. A catalog consumer that special-cased the old INT result could be surprised.
  • Best improvement: Add one sentence to the Impact bullet (en and zh) noting that getTable now reports 64-bit integer columns as BIGINT.
  • Severity: Low (non-blocking). Raised by another reviewer: No.

Issue 2: Small style nit, fully qualified ArrowType.Int in LanceCatalog

  • Location: LanceCatalog.java:449-452
  • Problem: The new local org.apache.arrow.vector.types.pojo.ArrowType.Int intType uses the fully qualified name, copying the surrounding style.
  • Risk: None, cosmetic.
  • Best improvement: Optional; leave as is for consistency with the adjacent branches, or import ArrowType when that method is next touched.
  • Severity: Low (non-blocking). Raised by another reviewer: No.

2. Code Quality

2.1 Coding Standards and Comments

Clean and minimal; the new branches are small and readable. The tests carry useful comments explaining why toString cannot see column types.

2.2 Tests and Stability: Stable

  • FragmentConverterTest.shouldKeepEveryBitOfABigint checks the schema convertSchema builds plus exact stored values at Long.MIN/MAX_VALUE, a 3e9 value and an epoch-millis value. It fails against the old int32 mapping, so it has real regression power.
  • shouldDeclareABigintColumnAsInt64InTheCatalogSchema covers the catalog create mapping.
  • LanceCatalogTest.getTable now asserts integer_col -> INT and long_col -> BIGINT, which exercises both read-side changes (the int64 label and convertDataType). The assertion that integer_col stays INT is a good guard against over-widening.
  • LanceIT.testBigintKeepsItsValue reads the dataset back and now fails on duplicated ids (chovy-3012's Issue 3, resolved: Assertions.assertNull(values.put(...))). It uses await().untilAsserted, no Thread.sleep. No existing tests were weakened or removed.

2.3 Documentation

en and zh Lance sink type tables and the notes on existing datasets are updated consistently, plus bilingual incompatible-changes.md entries. See Issue 1 for the one missing sentence.

3. Architectural Soundness

This is the precise fix at the right layer: the type declaration and the mapper, with the already-correct writer untouched. Keeping the change inside the Lance connector (no engine/API/shared-class edits) keeps the blast radius small. The read-side fix addresses the actual root of the mislabelling (ArrowType.Int collapsed to int32), not the symptom. History compatibility is handled by documentation rather than silent migration, which is appropriate here.

4. Issue Summary

# Severity Location Issue Blocking
1 Low incompatible-changes.md (en/zh) Mention that getTable now reports 64-bit ints as BIGINT No
2 Low LanceCatalog.java:449 Fully qualified type name, cosmetic No

Previous items: my earlier review had no blockers; chovy-3012's Issues 1, 2 and 3 are all resolved in this head.

5. Merge Recommendation

Conclusion: Ready to merge

Blockers: none on the source side. The only open gate at the time of this review is CI: the aggregate Build for b3cacb0c was still in progress when I checked, so please wait for it to finish green (the run lives in the contributor fork; I have not run anything locally).

Recommended non-blocking fixes: the two Low items above.

Overall assessment: Small, well-scoped, well-tested and well-documented correctness fix. The new commit closes the read-direction asymmetry cleanly, and the tests would fail against the old behaviour. Nice work.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the contribution. The CI fact cited in my last review has changed: the previously pending Apache Build is now SUCCESS on unchanged head b3cacb0c4e5c4dad4649b5078ffab0bb12847ed1. My last full review explicitly left no source blocker and only the CI gate outstanding. That CI-only blocker is now cleared, so I am submitting an approval.

I checked the exact SHA and successful job conclusions in the fork Build and the successful Apache aggregate. The executed JDK 11/17 unit and updated-module integration jobs passed; skipped lanes are not claimed as executed coverage. No local tests were run.

The two Low recommendations in my last review remain non-blocking. I agree with the earlier read-back coverage discussion with @chovy-3012 as reconciled in that review; no new source claim is being made here.

Daniel has READ repository permission. This APPROVED review records my technical conclusion; a write-capable maintainer must separately satisfy effective reviewer/merge requirements and reconcile any historical requested-changes entries. This is not a merge or dismissal action. The branch is diverged, ahead 3 / behind 7 against dev; that metadata alone requests no sync or rerun.

Checked 2026-11-01T10:00:07.995142+00:00. This is a CI-state follow-up, not another full source review.

# Conflicts:
#	docs/en/introduction/concepts/incompatible-changes.md
#	docs/zh/introduction/concepts/incompatible-changes.md

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked the new head 275eb7ec: the only change since my last review (b3cacb0c) is a merge of the latest dev; the PR's own diff (Lance BIGINT as int64 on write and read, tests and docs) is unchanged.

The apache-side Build is SUCCESS on this head (fork run 42398400468). My previous approval had no source blocker; the two Low recommendations remain optional. I have not run tests locally.

Conclusion: Ready to merge

Blockers: None

@davidzollo davidzollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
LGTM

@davidzollo
davidzollo added this pull request to the merge queue Nov 9, 2026
Merged via the queue into apache:dev with commit 535d423 Nov 9, 2026
3 checks passed
sharpca added a commit to sharpca/seatunnel that referenced this pull request Nov 10, 2026
Sync with the latest dev (apache#13061 merged the Lance BIGINT incompatible-change
entry right under '## dev'). Resolve the conflict in docs/en and docs/zh by keeping
both the Lance entry and the API locale entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Connector-V2][Lance] Lance sink wraps BIGINT values outside the int32 range

4 participants