Repository navigation
[fix](catalog) Keep the TIME scale that connectors declare - #70351
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
/review |
TPC-H: Total hot run time: 28636 ms |
TPC-DS: Total hot run time: 154547 ms |
ClickBench: Total hot run time: 24.02 s |
There was a problem hiding this comment.
Static review of PR #70351 at head 9a484e8 converged after 2 rounds. The TIMEV2 converter now reads the ConnectorType precision slot as the fractional scale, matching the current Hudi mappings for Avro time-millis/time-micros (3/6); omitted precision still produces the legacy scale-0 TIMEV2. All current FE conversion and schema-cache callers preserve the resulting ScalarType scale, and the current Lance mapping is a BE-side path that does not use this converter. No new P0/P1/P2/P3 finding was verified, and there are no existing blocking inline comment IDs applicable to this head. FE locking, exception/RPC-boundary, visible-version, and external-catalog initialization/reset checkpoints are not implicated by these two changed files. No additional user review focus was supplied. The pre-existing Hudi MOR/JNI rejection of Avro TIME logical types and the hypothetical future-plugin case of a TIMEV2 precision above Doris's scale-6 limit were inspected and dismissed as outside the changed reachable behavior; they are retained as coverage notes. Validation was static inspection only under the review contract; no builds or tests were executed.
Review converged after 2 round(s).
FE UT Coverage ReportIncrement line coverage |
|
run buildall |
TPC-H: Total hot run time: 28782 ms |
TPC-DS: Total hot run time: 154121 ms |
ClickBench: Total hot run time: 23.96 s |
|
run buildall |
|
/review |
There was a problem hiding this comment.
Static review of PR #70351 at head 9a484e8: no new actionable finding verified. Converged after 1 round with a complete reviewer and a separate risk reviewer, both returning NO_NEW_VALUABLE_FINDINGS, followed by independent main-agent verification and a final sweep of both changed files. No existing blocking inline findings apply; the supplied and refreshed live inline comment sets are empty. No additional user review focus was supplied.
Critical checkpoint conclusions:
- Goal and correctness: TIMEV2 now takes its fractional-second scale from ConnectorType.precision, matching Hudi's Avro time-millis/time-micros producers (3/6). Omitted precision preserves the previous scale-0 singleton. The added test checks 0, 3, 6, omitted precision and time(3) SQL rendering; assertions were inspected, not executed.
- Scope and reuse: the six-line production case uses the existing ScalarType factory and follows adjacent DATETIMEV2 handling; the other changed file adds one focused JUnit 5 test.
- Concurrency and locking: no new threads, shared mutations, locks, heavy work under locks or lock-order changes.
- Lifecycle and initialization: no new resource lifetime or static initialization dependency; explicit scale creates a local type and the fallback reuses the existing singleton.
- Configuration: no settings added or changed; dynamic-update propagation is inapplicable.
- Compatibility: no API symbols, connector SPI or storage layouts changed. The correction uses existing TIMEV2 scale representation and consumers; no new mixed-version incompatibility identified.
- Thrift/protobuf definitions: neither directory changed; field-id and enum-value comparisons are inapplicable.
- Parallel paths: ARRAY/MAP/STRUCT conversion recursively reaches this case; existing DATETIMEV2/TIMESTAMPTZ paths remain consistent. Shared reverse schema conversion serves DDL/write paths, while current Hudi scan handles come from original connector metadata. No newly failing read consumer found.
- Conditions and errors: precision >= 0 distinguishes explicit scale from the unset sentinel, with a comment matching the neighboring convention. Current TIMEV2 producers supply supported scales 3/6; no new swallowed error found.
- Test coverage: scalar scales/default and SQL rendering are covered, with existing Hudi producer assertions independently matching 3/6. No nested TIME-specific, invalid-scale or end-to-end regression case was added; recursive dispatch and actual producer bounds were inspected. Builds and tests were not run under the static-only contract.
- Expected test results: the added type and SQL expectations agree with ScalarType implementation; no golden output files changed.
- Observability: deterministic local type conversion adds no distributed operation requiring new logging or metrics.
- Transactions and persistence: no journal/replay, visible-version, delete-bitmap or failover logic changed.
- Writes and atomicity: no data-write operation or shared-state mutation introduced; transaction atomicity is unaffected.
- FE/BE propagation: no new transmitted variable; existing ScalarType thrift serialization and BE DataTypeTimeV2 construction preserve the supported scale.
- Performance and other issues: constant-time dispatch and a small per-type allocation match neighboring temporal cases; no material redundant work or further verified defect found. FE exception/RPC boundaries and external-catalog initialization/reset behavior are not changed.
Risk dispositions and limits: the unchanged reverse helper's TIMEV2 scale loss has no concrete new failure in current read paths. A separate predicate converter can emit catalog precision/scale, but residual predicates bind existing slots and remaining filters retain original BE conjuncts; they do not feed those types through this changed schema converter. Hudi partition-value types use the schema fallback. The pre-existing Hudi JNI rejection of Avro TIME logical types remains unchanged; this review and the new unit test establish metadata conversion behavior, not end-to-end Hudi time-column execution. Hypothetical future producers with scale above 6 were not treated as an introduced bug. No unresolved patch-specific candidate or unreviewed changed scope remains. Validation was static inspection only; no builds, tests or runtime validation were executed.
Review converged after 1 round(s).
### Background
Connector plugins (Hudi, and the coming Lance connector) describe their columns with the SPI's `ConnectorType`, and fe-core's `ConnectorColumnConverter` turns each into a Doris type. Connectors put a temporal column's fractional-second scale in the type's precision field: `("DATETIMEV2", 3, 0)` is `datetime(3)`, and Hudi's `HudiTypeMapping` sends `("TIMEV2", 3, 0)` for an Avro `time-millis` column and `("TIMEV2", 6, 0)` for `time-micros`.
### What problem does this PR solve?
Issue Number: None
Related PR: apache#62183 (introduced the converter without a TIMEV2 case), apache#64304 (moved Hudi onto it)
PR Type: Bugfix
Problem Summary:
Since Hudi became a connector plugin, its `time-millis` and `time-micros` columns show as `time` instead of `time(3)` and `time(6)`, which is what 4.x shows and what `HudiTypeMapping` asks for: the converter drops the scale and builds a scale-0 TIMEV2. The Lance connector, ported in a follow-up, maps Arrow `time32(ms)` and `time64` the same way and would lose its scale too. The converter now reads the TIMEV2 scale from the precision field, as it already does for DATETIMEV2.
### Details
- **Frequency:** Always, for every connector column whose `ConnectorType` is TIMEV2 with a scale; today that is every Hudi `time-millis` / `time-micros` column on master. Found while porting the Lance connector, by reading the converter, and confirmed by the unit test below.
- **Root cause:** `ConnectorColumnConverter.convertScalarType` reads the precision field for CHAR, VARCHAR, VARBINARY, the decimals, DATETIMEV2 and TIMESTAMPTZ, but has no TIMEV2 case, so TIMEV2 falls through to `ScalarType.createType("TIMEV2")`, which returns the scale-0 `ScalarType.TIMEV2`.
- **Why existing tests missed it:** Unit tests: `ConnectorColumnConverterTest` checks decimals, CHAR/VARCHAR lengths and the TIMESTAMPTZ extra info but has no TIMEV2 case, and `HudiTypeMappingTest` asserts the `("TIMEV2", 3, 0)` the plugin emits but stops before fe-core converts it. Regression: no suite under `regression-test/suites` reads a Hudi time column.
- **Fix:** The TIMEV2 case uses the precision field as the scale when one is given; without one the type stays the scale-0 TIMEV2 it has always been. The fix sits in the converter because every connector goes through it. The reverse direction, `toConnectorType`, is unchanged: only the read-only Hudi and Lance connectors produce TIMEV2, and the JDBC connector maps TIME to STRING.
- **Other paths and branches:** `toConnectorType` is not affected for reads (see Fix). branch-4.1 and branch-4.2 are not affected: they have no `ConnectorColumnConverter`, and their fe-core Hudi mapping (`HudiUtils`) builds `createTimeV2Type(3)` / `createTimeV2Type(6)` directly. The bug is on master since apache#64304.
### Testing
- `ConnectorColumnConverterTest#timeScaleRidesInThePrecisionSlot` (new): fails before the fix with `expected: <timev2(3)> but was: <timev2(0)>` and passes after; it also pins that a TIMEV2 without a precision stays scale 0. Run locally on master `f5c993f2c94` with apache#70338 applied, which touches neither file.
- `ConnectorColumnConverterTest` (35 tests) and `HudiTypeMappingTest` (17 tests): pass locally on the same tree.
### Release note
None
### Check List (For Author)
- Behavior changed: No
- Does this need documentation: No
- Pre-submission status: Ready
### AI Disclosure
- Tool: Claude Code (Claude Opus 5.5)
- Generated: code, tests, this description
- Human review: not stated
- Prompts: The author asked to port the branch-4.2 Lance FE read path to master as a connector plugin; this fix came out of that port, and the author's rule for such finds is to fix them in their own PR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9a484e8 to
85af975
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Static review of PR #70351 at head 85af975 found no new actionable defect in the complete two-file diff. No existing blocking inline findings apply, and no additional user review focus was supplied.
Critical checkpoint conclusions:
- Goal and correctness: the new TIMEV2 case reads fractional scale from ConnectorType.precision, matching Hudi's Avro time-millis/time-micros mappings (3/6). Omitted precision keeps the existing scale-zero TIMEV2. The added test checks 0/3/6, omitted precision, and time(3) SQL rendering; ScalarType equality compares TIMEV2 scale, so these assertions detect the original bug.
- Scope and reuse: six production lines reuse ScalarType.createTimeV2Type and follow adjacent DATETIMEV2 handling; one focused JUnit 5 test is added.
- Concurrency and locks: no new thread, shared mutation, lock, lock-order change, or IO under locks.
- Lifecycle and initialization: parameterized conversion constructs a local type; fallback uses the existing singleton. No resource ownership, callback, cycle, or static initialization dependency is introduced.
- Configuration: no settings or dynamic-update behavior changed.
- Compatibility: existing TIMEV2 scale representation is reused; no API/SPI symbol or storage layout changed, and no new rolling-upgrade incompatibility was identified.
- Thrift/protobuf definitions: neither directory changes; cross-branch field-ID and enum comparisons are inapplicable.
- Parallel paths: ARRAY/MAP/STRUCT conversion recursively reaches the same scalar case. Schema-cache callers retain the resulting type. Current TIMEV2-producing Hudi schemas are read-only; the unchanged reverse schema helper is used for DDL/write conversion, and predicates use a separate converter. No concrete newly failing reverse path was found.
- Conditional checks and errors: precision >= 0 distinguishes explicit scale, including zero, from the unset sentinel. Its comment matches the neighboring convention. Current connector producers supply supported scales 3/6; no introduced swallowed failure was found.
- Test coverage: the new direct unit test covers current producer scales and fallback; existing Hudi mapping tests independently pin 3/6. No new end-to-end, nested TIME-specific, or invalid-scale test is added. Recursive dispatch and current producer bounds were inspected. No builds or tests were executed under the static-only contract.
- Test results: expected types and SQL text match the implementation; no golden result files changed. Test execution claims in the PR description were not independently reproduced.
- Observability: local deterministic conversion adds no distributed operation or new failure path requiring logs or metrics.
- Transactions and persistence: no journal/replay, failover, visible-version, delete-bitmap, or transaction-visibility logic changed.
- Data writes and atomicity: no data-write operation or new mutable shared state is introduced; crash recovery and transaction atomicity are unaffected by the changed logic.
- FE/BE propagation: no transmitted variable is added. Existing ScalarType TypeDesc/TColumnType serialization, catalog decoding, Nereids TIMEV2 conversion, and BE DataTypeTimeV2 construction preserve supported scales.
- Performance and other issues: constant-time scalar dispatch and one type allocation match neighboring temporal cases; no material redundant work or memory-lifetime issue was found. FE exception/RPC boundaries and external-catalog initialization, name mapping, and reset behavior are unchanged.
Risk dispositions and validation limits: current connector producers emit only supported TIMEV2 scales 3/6; hypothetical future producers exceeding scale 6 do not establish a bug in this patch. The pre-existing reverse helper's TIMEV2 scale omission has no verified new failure in current read paths. Hudi's JNI Hive-type conversion already rejects Avro TIME logical types; that limitation is unchanged, while native Parquet schema handling supports scales 3/6. These observations establish the metadata conversion fix by static tracing, not end-to-end Hudi execution. No unresolved patch-specific candidate or unreviewed changed scope remains. Validation consisted solely of static inspection, with no builds, tests, or runtime validation.
Review converged after 2 round(s).
|
run external |
…ogs and basic reads (#70681) ### Background Lance datasets store schemas, versions and fragment lists in manifests. FE reads those manifests to plan a query, and BE reads the fragments through lance-c. Doris 4.1/4.2 provide Lance catalogs in fe-core; master uses connector plugins and already has the BE reader (#69581) and legacy image migration (#69575). ### What problem does this PR solve? Issue Number: #70680 Related PR: #65730, #66581, #66597, #66805 (source read-path changes); #70338 (secret masking), #70351 (TIMEV2 precision), #69581 (BE reader), #69575 (legacy images) PR Type: Feature Problem Summary: Master has no plugin serving the `lance` catalog type, so users cannot query Lance catalogs after upgrading from 4.1/4.2. This ports the first part of that read path: filesystem catalogs, static S3 credentials, Arrow type mapping, basic scans and main-chain time travel. The plugin also needs JNI packaging and resource management; other catalog types keep their existing behavior. ### Details - **Change map:** 57 files, +6732/-2: production code +3377, tests +2974, generated test output +75, build/CI +306/-2. Production has four parts: property binding and namespace lifetime; schema and version resolution; S3 storage-option translation shared by FE/BE; fragment scan planning. Tests cover those contracts, native datasets and a regression suite. Packaging registers the module, plugin distribution, JNI replacement and MinIO fixture. - **Scope:** Local/file and S3 filesystem catalogs; `SHOW DATABASES/TABLES`, `DESC`, `SELECT`, `FOR VERSION AS OF n`, and `FOR TIME AS OF 'yyyy-MM-dd HH:mm:ss[.SSS]'`. REST catalogs fail explicitly until the next PR, including first access to replayed REST catalogs. Tags, branches, OSS warehouses, pushdown and writes are outside this PR. S3 access without static AK/SK, including anonymous and credential-chain access, fails explicitly. AssumeRole is also rejected, even when source AK/SK are provided. - **Design:** Follow the existing connector plugins, rather than add Lance catalog classes to fe-core. The plugin opts into MVCC and memoizes metadata per statement, so schema, fragments, statistics and BE ranges use one immutable dataset version. Ordinary query pins retain their schema across the engine schema-cache boundary; historical statistics also apply the snapshot to unpinned handles. Time travel compares manifest commit times at their original precision in the session time zone. The final S3 endpoint fills both native endpoint coordinates after namespace options are merged, preventing ambient AWS endpoint overrides while preserving namespace service-endpoint precedence. Each fragment becomes one scan range. An in-flight call count delays native resource disposal after catalog retirement. Proposed in #70680, opened with this PR; no community design discussion has taken place yet. - **Usage:** ```sql CREATE CATALOG lance_s3 PROPERTIES ( "type" = "lance", "warehouse" = "s3://warehouse/lance", "s3.endpoint" = "http://127.0.0.1:9000", "s3.access_key" = "admin", "s3.secret_key" = "password", "s3.region" = "us-east-1", "use_path_style" = "true" ); SELECT count(*) FROM lance_s3.`default`.all_types FOR VERSION AS OF 1; SELECT count(*) FROM lance_s3.`default`.all_types FOR TIME AS OF '2026-07-30 10:11:50'; ``` - **Default behavior:** Enabled by creating a Lance catalog. `lance.conf` contains the optional `lance_catalog_arrow_memory_limit_bytes`, default 256 MiB per catalog; changes require an FE restart. - **Compatibility:** Preserve the 4.1/4.2 property map and names. Legacy catalogs use the existing image migration. The Arrow memory setting moves from fe.conf to lance.conf; copy any customized value. `SHOW CREATE TABLE` uses `ENGINE=lance`, as other plugins do. No Thrift or persisted-metadata format changes. BE needs #69581; projecting Arrow Null, Duration, JSON or bfloat16 fences out smooth-upgrade source BEs. Newer catalog features remain unsupported during this staged port. Both cloud and shared-nothing use this planning path; a cloud deployment was not tested locally. - **Persistence and failure handling:** Catalog metadata uses the existing plugin catalog journal/image path; dataset contents are read-only. The namespace opens lazily, avoiding storage I/O and JNI loading during replay. Missing versions and unavailable native libraries fail explicitly. Statement cleanup releases its metadata memo; dropping or altering a catalog retires its client and closes resources after active calls finish. - **Security and privileges:** CREATE_PRIV permits catalog creation; ALTER_PRIV is required to change its properties. FE and BE make outbound HTTP requests to the configured S3 endpoint, an SSRF surface. The provider declares S3-compatible endpoint aliases for the existing CREATE/ALTER gate when `security_checker_class_name` is configured. REST credential keys are declared for masking even though REST reads are deferred. Build-time JNI replacement downloads fixed, checksum-pinned Lance JNI and Apache Arrow Java source assets. - **Follow-up plan:** REST/OSS and namespace-vended credentials; predicate/LIMIT/COUNT pushdown, fragment grouping and scalar indexes; then session/table caches and profile counters. Search TVFs, index operations and tag/branch/managed versioning follow separately under #70680. ### Testing - Storage/JNI fixes at `536982b`, macOS arm64/JDK 17: all 81 Lance tests in 14 classes passed, with no skips, through `run-fe-ut.sh --run` and a scoped `CUSTOM_MVN` wrapper. Checkstyle was enabled and Maven build cache disabled. Cases include role plus source keys, generic/service endpoint precedence, explicit HTTP policy, and native HTTP requests under unrelated AWS endpoint and credential variables. - On the unfixed `b62c94c`, the same targeted Java tests produced 5 assertion failures across 14 tests with no skips. The native child actually requested the unrelated endpoint at port 1. The real shell helper also failed with JAVA_HOME unset; all three JDK-selection cases pass with the fix. - Shell packaging tests cover JAVA_HOME, selected JAVA, PATH-only discovery, jar/platform isolation, checksum/version/runtime gates and failure atomicity. The real Arrow JNI helper compiled with JAVA_HOME unset, and the native HTTP test passed using that rebuilt library; JVM library logs confirmed its path. - External CI at `536982b` passed 809 of 810 tests. The AssumeRole negative case failed because its private endpoint selected the MinIO provider, whose HMAC-only validation ran before Lance. The fixture now sets `provider=S3` for that catalog and keeps the exact Lance exception assertion. - Provider fixture fix, macOS arm64/JDK 17: `run-fe-ut.sh --run` with a scoped `CUSTOM_MVN` wrapper passed 54 tests in `LanceStorageOptionsTest`, `S3FileSystemProviderTest`, `MinioFileSystemProviderTest` and `MinioFileSystemPropertiesTest`, with no skips, Checkstyle enabled and Maven build cache disabled. A probe extracted the baseline and candidate catalog properties from the Groovy suite and used freshly compiled production providers and Lance options: the baseline reproduced the MinIO rejection; the candidate retained the role and reached the exact Lance AssumeRole rejection. Groovy parsing and `git diff --check` passed. The complete SQL suite and full External rerun remain pending at the new head. - Earlier validation at `b62c94c` reported 78 Lance tests, 162 Connector SPI tests and 16 foundation binding tests passing. Initial feature validation reported 507 related FE tests, `build.sh --fe`, and the MinIO regression with this worktree's compatible BE `33d48fcf6da`. Those runs predate this follow-up and are not current cluster verification. A full External rerun, cloud, current-master BE and Linux/glibc 2.17 execution remain unverified at the new head. ### Notes for Reviewers - The BE Lance reader does not consume `history_schema_info`. Omitting it retains FileScannerV2's exact-name matching, which the reader tests exercise. - Native FE tests skip explicitly on hosts unable to load Lance or Arrow C Data JNI. The External pipeline enables the MinIO fixture and runs the new regression suite. Linux x86_64 deployment rebuilds Arrow C Data JNI with the Doris C++ toolchain, statically links its C++ runtimes and replaces only that jar entry. This build step needs a JDK, C++ compiler and `readelf`; it honors JAVA_HOME or discovers java.home from the JVM selected by env.sh, including PATH-only JDK installations; releases targeting glibc 2.17 must use the corresponding Doris build environment. Linux/CentOS 7 execution of this new build step remains untested locally.
Background
Connector plugins (Hudi, and the coming Lance connector) describe their columns with the SPI's
ConnectorType, and fe-core'sConnectorColumnConverterturns each into a Doris type. Connectors put a temporal column's fractional-second scale in the type's precision field:("DATETIMEV2", 3, 0)isdatetime(3), and Hudi'sHudiTypeMappingsends("TIMEV2", 3, 0)for an Avrotime-milliscolumn and("TIMEV2", 6, 0)fortime-micros.What problem does this PR solve?
Issue Number: None
Related PR: #62183 (introduced the converter without a TIMEV2 case), #64304 (moved Hudi onto it)
PR Type: Bugfix
Problem Summary:
Since Hudi became a connector plugin, its
time-millisandtime-microscolumns show astimeinstead oftime(3)andtime(6), which is what 4.x shows and whatHudiTypeMappingasks for: the converter drops the scale and builds a scale-0 TIMEV2. The Lance connector, ported in a follow-up, maps Arrowtime32(ms)andtime64the same way and would lose its scale too. The converter now reads the TIMEV2 scale from the precision field, as it already does for DATETIMEV2.Details
ConnectorTypeis TIMEV2 with a scale; today that is every Huditime-millis/time-microscolumn on master. Found while porting the Lance connector, by reading the converter, and confirmed by the unit test below.ConnectorColumnConverter.convertScalarTypereads the precision field for CHAR, VARCHAR, VARBINARY, the decimals, DATETIMEV2 and TIMESTAMPTZ, but has no TIMEV2 case, so TIMEV2 falls through toScalarType.createType("TIMEV2"), which returns the scale-0ScalarType.TIMEV2.ConnectorColumnConverterTestchecks decimals, CHAR/VARCHAR lengths and the TIMESTAMPTZ extra info but has no TIMEV2 case, andHudiTypeMappingTestasserts the("TIMEV2", 3, 0)the plugin emits but stops before fe-core converts it. Regression: no suite underregression-test/suitesreads a Hudi time column.toConnectorType, is unchanged: only the read-only Hudi and Lance connectors produce TIMEV2, and the JDBC connector maps TIME to STRING.toConnectorTypeis not affected for reads (see Fix). branch-4.1 and branch-4.2 are not affected: they have noConnectorColumnConverter, and their fe-core Hudi mapping (HudiUtils) buildscreateTimeV2Type(3)/createTimeV2Type(6)directly. The bug is on master since [refactor](catalog) decouple external catalogs from FE core into loadable connector plugins #64304.Testing
ConnectorColumnConverterTest#timeScaleRidesInThePrecisionSlot(new): fails before the fix withexpected: <timev2(3)> but was: <timev2(0)>and passes after; it also pins that a TIMEV2 without a precision stays scale 0. Run locally on masterf5c993f2c94with [fix](catalog) Mask connector catalog secrets and the ALTER CATALOG audit text #70338 applied, which touches neither file.ConnectorColumnConverterTest(35 tests) andHudiTypeMappingTest(17 tests): pass locally on the same tree.Release note
None
Check List (For Author)
AI Disclosure