Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Paimon Java accepts TIME columns in Lance data files: LanceFileFormat.LanceRowTypeVisitor.visit(TimeType) accepts the type, ArrowFieldTypeConversion writes it as Arrow TIMEMILLI (time32[ms]), and the Lance type mapping in Paimon's docs/docs/concepts/spec/fileformat.md lists TIME → TIME32 / TIME64.
Paimon C++ has represented TIME as time32[ms] since #378, and Parquet and Vortex already support it. Lance does not:
SchemaValidation::ValidateLanceDataField()has noTIME32case. A TIME column falls through todefaultand is rejected withLance file format does not support type time32[ms](src/paimon/core/schema/schema_validation.cpp:1026).SchemaValidationTest.TestLanceDataTypesasserts this rejection (src/paimon/core/schema/schema_validation_test.cpp:480).LanceStatsExtractor::CreateEmptyStats()has noTIME32case either (src/paimon/format/lance/lance_stats_extractor.cpp:108). Lifting only the validation would therefore still fail when an append data file with a TIME column is finalized, withcannot create empty Lance statistics for type time32[ms]. This is the same failureVortexTimeColumnWriteInteTest.TestAppendTimeColumnFinalizeguards against for Vortex.
Both sides use the same physical type, so the gap is only the C++ gating.
Solution
- Accept
TIME32inValidateLanceDataField(), including when nested in ARRAY and ROW. Non-millisecond units are already rejected earlier byTableSchema::Create()(Only millisecond TIME is supported). - Add a
TIME32case toLanceStatsExtractor::CreateEmptyStats(), followingVortexStatsExtractor(src/paimon/format/vortex/vortex_stats_extractor.cpp:109), which returns emptyCreateIntColumnStats. - No reader change is expected. The declared precision comes from the table schema (
paimon.time.precisionfield metadata), andLanceFileBatchReader::AlignBatch()aligns each batch to the read type.
Anything else?
Suggested validation:
- Update the
TestLanceDataTypesexpectations so millisecond TIME, top level and nested, is accepted. - Add a format-level round trip in
src/paimon/format/lance/lance_file_format_test.cppcovering nulls and TIME nested in ARRAY and ROW. - Add a table-level append write and finalize test, like
VortexTimeColumnWriteInteTest.TestAppendTimeColumnFinalize(test/inte/write_and_read_inte_test.cpp:5984). - Add a Java compatibility fixture with a TIME column, read from C++. The README of
test/test_data/lance/append_java_compat.db/append_java_compatsays "TIME32 is omitted because the C++ table path does not support it", which no longer holds. Prefer adding a new fixture over rewriting the existing one.
This needs no storage format or protocol change. TIMESTAMP_LTZ support for Lance is tracked in #476.
Are you willing to submit a PR?
- I'm willing to submit a PR!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity