diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SlotBinder.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SlotBinder.java index 5c96ff8bd2..7f6e23a120 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SlotBinder.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SlotBinder.java @@ -260,6 +260,9 @@ public class SlotBinder extends SubExprAnalyzer { } }).collect(Collectors.toList()); + if (slots.isEmpty()) { + throw new AnalysisException("unknown qualifier: " + StringUtils.join(qualifierStar, ".") + ".*"); + } return new BoundStar(slots); } diff --git a/regression-test/suites/nereids_rules_p0/bind_relation/bind_view.groovy b/regression-test/suites/nereids_rules_p0/bind_relation/bind_view.groovy index b69fddad1d..45d55d83e3 100644 --- a/regression-test/suites/nereids_rules_p0/bind_relation/bind_view.groovy +++ b/regression-test/suites/nereids_rules_p0/bind_relation/bind_view.groovy @@ -49,6 +49,13 @@ suite("test_bind_view") { ); """ + test { + sql """ + select ggg.* from ( select * from ${table_name} ) l; + """ + exception "unknown qualifier:" + } + try { sql """