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

Method empty_projection_fallback

datafusion/sql/src/unparser/plan.rs:2019–2025  ·  view source on GitHub ↗

Generates appropriate projection expression for empty projection lists. Returns an empty vec for dialects supporting empty select lists, or a dummy literal `1` for other dialects.

(&self)

Source from the content-addressed store, hash-verified

2017 /// Returns an empty vec for dialects supporting empty select lists,
2018 /// or a dummy literal `1` for other dialects.
2019 fn empty_projection_fallback(&self) -> Vec<Expr> {
2020 if self.dialect.supports_empty_select_list() {
2021 Vec::new()
2022 } else {
2023 vec![Expr::Literal(ScalarValue::Int64(Some(1)), None)]
2024 }
2025 }
2026
2027 /// Decides where extracted table-scan filters belong in the unparsed SQL:
2028 /// in the `JOIN ON` clause or in `WHERE`.

Callers 1

Calls 2

newFunction · 0.85

Tested by

no test coverage detected