Gabriel39 opened a new pull request, #71321: URL: https://github.com/apache/doris/pull/71321
### What problem does this PR solve? Issue Number: None Related PR: apache/doris#71242 Backport [apache/doris#71242](https://github.com/apache/doris/pull/71242), master commit `d026e254d0a24af87390a1d7bdf0dbdf931d5193`, to `branch-4.1`. `COUNT(*)` and other constant projections can retain an unsupported fallback column from an external schema and crash BE during descriptor construction. Reject unsupported-only scans, choose readable fallback columns for mixed schemas, and guard both FE serialization and BE descriptor ingestion. Preserve the existing column-authorization requirements, including eliminated subqueries. ### Branch adaptations - Put the serialization guard in the branch's `SlotDescriptor.toThrift()` and keep its descriptor-table API. - Retain the branch's existing authorization implementation and scan translation; backport the logical fallback checks without importing unrelated master refactors. - Use Java 8-compatible collections and the branch's aggregate-state test constructor. The PostgreSQL regression suite and generated result snapshot match upstream byte for byte. ### Validation - Fresh repository FE build and targeted tests passed: 55 tests, zero failures, errors or skips. Covers scan-slot validation, unsupported logical fallback selection, COUNT(*) ordering, column pruning, expression utilities and column privileges. - FE Checkstyle passed for `fe-common` and `fe-core`; clang-format 16 passed for both changed C++ files. - Both changed C++ production/test translation units compiled with ASAN instrumentation. Existing deprecated-API and shadow warnings were left nonfatal for the local toolchain; no build-policy changes are included. - The PostgreSQL Groovy suite compiled. Live PostgreSQL regression and BE unit-test execution were not run locally and remain for CI. ### Release note External queries that retain an unsupported scan column now report an error instead of crashing BE. Supported columns in mixed schemas remain usable. ### Check List (For Author) - [x] Regression tests included - [x] Unit tests included - Behavior changed: Yes, unsupported scans fail with a descriptive error. - Documentation needed: No. -- 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]
