Skip to content

fix(datafusion): surface tag create-time and retention in $tags - #728

Merged
JingsongLi merged 1 commit into
apache:mainfrom
jackylee-ch:fix/tags-create-time-retention
Aug 20, 2026
Merged

fix(datafusion): surface tag create-time and retention in $tags#728
JingsongLi merged 1 commit into
apache:mainfrom
jackylee-ch:fix/tags-create-time-retention

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

A tag written by Flink or Spark carries tagCreateTime and tagTimeRetained
next to the snapshot fields, but $tags reported both columns as NULL for
every row. TagManager deserialized the tag file straight into Snapshot, which
has no such fields, and nothing rejects unknown keys — so the values on disk were
dropped silently and the table hard-coded two null arrays.

Jackson's shape is easy to get wrong. JsonSerdeUtil registers JavaTimeModule
without disabling WRITE_DATES_AS_TIMESTAMPS, so tagCreateTime is the array
[year, month, day, hour, minute, second, nanoOfSecond] with trailing zero
components omitted — five items is legal — and tagTimeRetained is a decimal
seconds number, not an ISO string. pypaimon's time_utils encodes exactly this
and states it matches LocalDateTimeSerializer byte for byte.

Fix: TagManager::get_with_metadata / list_all_with_metadata parse the two
fields alongside the snapshot, padding a short array back to seven components.
Parsing is deliberately lenient: an unexpected shape leaves that one column
NULL rather than failing the query, so a hand-edited tag file cannot break a
listing. $tags renders the retention like Java's Duration.toString().

Read side only. Making sys.create_tag write these fields belongs with the
procedure, which #489 is currently changing.

@JingsongLi JingsongLi 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

@JingsongLi
JingsongLi merged commit 59bc642 into apache:main Aug 20, 2026
13 checks passed
jerry-024 added a commit to jerry-024/paimon-rust that referenced this pull request Aug 21, 2026
* main:
  perf: vectorize raw vector search (apache#734)
  feat(file_index): add predicate evaluation foundation (apache#721)
  feat(go): add postpone fixed-bucket write bindings (apache#722)
  perf(vindex): split build timing logs by phase (apache#723)
  fix(avro): read TIME, BLOB, MULTISET and non-string-key map columns (apache#724)
  fix(datafusion): surface tag create-time and retention in $tags (apache#728)
  [core] Support multivalue global index (apache#731)
  feat: add Java-compatible array predicate pushdown (apache#732)
  fix: serialize unbounded varchar as string (apache#730)
  perf(vindex): decouple vector read threads and remove chunk barrier (apache#720)
  feat(vindex): add DiskANN and IVF-SQ/RQ support (apache#726)

# Conflicts:
#	crates/paimon/src/table/data_file_reader.rs
#	crates/paimon/src/table/vindex_index_build_builder.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants