HappenLee commented on code in PR #64563:
URL: https://github.com/apache/doris/pull/64563#discussion_r3481168393
##########
be/src/exprs/vcolumn_ref.h:
##########
@@ -91,8 +110,45 @@ class VColumnRef final : public VExpr {
double execute_cost() const override { return 0.0; }
private:
+ int _get_column_position(VExprContext* context, const Block* block) const {
+ if (context != nullptr) {
+ const auto resolve_result =
+
context->lambda_execution_context().resolve_column_position(_column_name);
+ if (resolve_result.found) {
+ return resolve_result.column_position;
+ }
+ if (resolve_result.searched_named_scope) {
+ return -1;
+ }
+ }
+ return _get_column_position_without_context(block);
+ }
+
+ int _get_column_position_without_context(const Block* block) const {
+ if (!_gap_set.load()) {
+ const int position_by_name = _find_column_position_by_name(block);
+ if (position_by_name >= 0) {
+ return position_by_name;
+ }
+ }
+ return _column_id + _gap.load();
+ }
+
+ int _find_column_position_by_name(const Block* block) const {
+ if (block == nullptr) {
Review Comment:
这个block也不应是空的,你把这个空指针的check代码都梳理一下
--
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]