Mryange opened a new pull request, #61941:
URL: https://github.com/apache/doris/pull/61941
### What problem does this PR solve?
`TYPE_LAMBDA_FUNCTION` (enum value 33) is not a real column data type — it
is a semantic tag for lambda expressions. Lambda execution is entirely driven
by `TExprNodeType::LAMBDA_FUNCTION_EXPR`, not `PrimitiveType`. Having it in the
`PrimitiveType` enum pollutes the enum semantics and causes a structural
inconsistency in `VLambdaFunctionExpr._data_type`.
### Changes
1. **Mark `TYPE_LAMBDA_FUNCTION` as `[[deprecated]]`** in
`define_primitive_type.h` (enum value 33 is preserved for ABI compatibility).
2. **`from_thrift()`**: Map `TPrimitiveType::LAMBDA_FUNCTION` →
`TYPE_STRING` instead of `TYPE_LAMBDA_FUNCTION`. This is semantically
equivalent since `DataTypeFactory` always created `DataTypeString` for it
anyway. Thrift protocol compatibility is maintained (old FE → new BE still
works).
3. **Remove all BE references** to `TYPE_LAMBDA_FUNCTION`:
- `to_thrift()` / `type_to_string()` — removed switch cases (all have
`default:` branches)
- `data_type_factory.cpp` — removed case (falls through to `default:`)
- `data_type_decimal.cpp` — removed dead code branch (unreachable since
`create_data_type(TYPE_LAMBDA_FUNCTION)` returns `DataTypeString` whose
`get_primitive_type()` is `TYPE_STRING`)
- `tablet_schema.cpp` — removed case (identical to `default:` behavior)
- `cast_test.h` — removed case (identical to `default:` behavior)
4. **Fix `VLambdaFunctionExpr._data_type` inconsistency**: In `prepare()`,
override `_data_type` with `get_child(0)->data_type()` (the lambda body's
actual return type) instead of keeping the placeholder `DataTypeString`.
### Release note
None
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
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]