MCPcopy Create free account
hub / github.com/apache/datafusion / validate_single_column

Method validate_single_column

datafusion/sql/src/expr/subquery.rs:128–144  ·  view source on GitHub ↗
(
        &self,
        sub_plan: &LogicalPlan,
        spans: &Spans,
        error_message: &str,
        help_message: &str,
    )

Source from the content-addressed store, hash-verified

126 }
127
128 fn validate_single_column(
129 &self,
130 sub_plan: &LogicalPlan,
131 spans: &Spans,
132 error_message: &str,
133 help_message: &str,
134 ) -> Result<()> {
135 if sub_plan.schema().fields().len() > 1 {
136 let sub_schema = sub_plan.schema();
137 let field_names = sub_schema.field_names();
138 let diagnostic =
139 self.build_multi_column_diagnostic(spans, error_message, help_message);
140 plan_err!("{}: {}", error_message, field_names.join(", "); diagnostic=diagnostic)
141 } else {
142 Ok(())
143 }
144 }
145
146 fn build_multi_column_diagnostic(
147 &self,

Callers 3

parse_in_subqueryMethod · 0.80
parse_scalar_subqueryMethod · 0.80

Calls 5

field_namesMethod · 0.80
lenMethod · 0.45
fieldsMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected