morningman opened a new pull request, #71465: URL: https://github.com/apache/doris/pull/71465
### Background A standard Iceberg view stores a declared schema, naming context, and SQL representations in its current version. Doris uses the Iceberg view API for Iceberg catalogs. A shared Hive Metastore can store both standard Iceberg views and traditional Hive views. ### What problem does this PR solve? Issue Number: close #71464 Related PR: None PR Type: Feature Problem Summary: Users sharing Iceberg views with Spark need Doris to execute the stored Doris SQL. The existing engine-based preference can select Spark SQL even when the current version contains a Doris representation. This change selects Doris SQL deterministically and routes ordinary Hive catalogs to the versioned metadata for standard Iceberg views. Existing catalogs that rely on the previous selection policy can set `iceberg.view.dialect-mode=legacy`. ### Details - **Change map:** Production code +934/-202, tests +526/-206, generated regression output +39/-58, and build metadata +6/-1. The connector changes classify HMS relations and expose a versioned view snapshot. The FE changes select the dialect, bind its query in the saved namespace, validate the declared columns, and expose diagnostics. The SPI inventory and tests cover compatibility, error cases, and the three catalog entry points. - **Scope:** Read standard views through Iceberg REST, Iceberg HMS, and a Hive catalog sharing the HMS. An Iceberg HMS catalog can opt into reading traditional Hive views. - **Design:** Use HMS object markers and the current Iceberg metadata. Reusing the mirror text would discard the other representations and the declared schema. Keep one snapshot per statement and caller. The linked issue describes the design. - **Usage:** Run `SHOW VIEW DIALECTS FROM lake.sales.summary_view` to see the current version, stored dialects, and selected dialect. Use `DESC lake.sales.summary_view` to see the declared columns and `SELECT * FROM lake.sales.summary_view` to execute the selected representation. - **Default behavior:** REST and Iceberg HMS use `compatible` mode. `iceberg.view.compatible-dialects` defaults to `spark`. An explicitly empty list accepts Doris SQL only. This change leaves Spark conversion for follow-up work. `iceberg.hms.hive-view.enabled` defaults to `false`. - **Compatibility:** The FE uses the existing table metadata and wire formats. Connector API major 44 adds default methods and the loader can still admit version 43 plugins. Explicit legacy mode preserves the original representation selection and session conversion. - **Security and privileges:** Standard view dependencies use the caller's privileges. Diagnostics use existing SHOW visibility. Connector reads use the catalog's configured endpoints and existing authentication. - **Behavior change:** Compatible mode selects the stored Doris representation independently of the originating engine and the outer session dialect. The statement binds against the declared schema and reports incompatible metadata. - **Follow-up plan:** Add representation writes and source dialect translation in separate changes. ### Testing - `./build.sh --fe` and `./build.sh --be -j 12` passed locally. The FE build ran Checkstyle. - Ran 182 targeted SPI, loader, connector, and FE unit tests with no failures or skips. - An API 43 Hive plugin archive loaded in the API 44 FE and returned its traditional view definition through the default adapter. - `test_iceberg_view_query_p0` passed against a local cluster and real Iceberg REST, Hive 3.1.2, and HDFS fixtures. It exercised the three catalog entry points, legacy selection, view diagnostics, schema drift, nested scope, dependency privileges, cycles, and refresh. ### Release note Doris can read the current Doris SQL representation of a standard Iceberg view through REST or Hive Metastore. `SHOW VIEW DIALECTS FROM` shows the current version and SQL selection. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes. Document the dialect policy, catalog properties, and diagnostic command in apache/doris-website. - Pre-submission status: Partially verified: a live mixed-version FE/BE rolling upgrade was not exercised. ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Implementation, regression fixtures, tests, and description draft - Human review: The author did not report separate review coverage. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
