@@ -1931,12 +1931,10 @@ fn project_with_validation(
19311931 expr : impl IntoIterator < Item = ( impl Into < SelectExpr > , bool ) > ,
19321932) -> Result < LogicalPlan > {
19331933 let mut projected_expr = vec ! [ ] ;
1934- let mut has_wildcard = false ;
19351934 for ( e, validate) in expr {
19361935 let e = e. into ( ) ;
19371936 match e {
19381937 SelectExpr :: Wildcard ( opt) => {
1939- has_wildcard = true ;
19401938 let expanded = expand_wildcard ( plan. schema ( ) , & plan, Some ( & opt) ) ?;
19411939
19421940 // If there is a REPLACE statement, replace that column with the given
@@ -1957,7 +1955,6 @@ fn project_with_validation(
19571955 }
19581956 }
19591957 SelectExpr :: QualifiedWildcard ( table_ref, opt) => {
1960- has_wildcard = true ;
19611958 let expanded =
19621959 expand_qualified_wildcard ( & table_ref, plan. schema ( ) , Some ( & opt) ) ?;
19631960
@@ -1987,12 +1984,6 @@ fn project_with_validation(
19871984 }
19881985 }
19891986 }
1990- if has_wildcard && projected_expr. is_empty ( ) && !plan. schema ( ) . fields ( ) . is_empty ( ) {
1991- return plan_err ! (
1992- "SELECT list is empty after resolving * expressions, \
1993- the wildcard expanded to zero columns"
1994- ) ;
1995- }
19961987 validate_unique_names ( "Projections" , projected_expr. iter ( ) ) ?;
19971988
19981989 Projection :: try_new ( projected_expr, Arc :: new ( plan) ) . map ( LogicalPlan :: Projection )
0 commit comments