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

Method build

datafusion/sql/src/unparser/ast.rs:88–116  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

86 self.distinct_union
87 }
88 pub fn build(&self) -> Result<ast::Query, BuilderError> {
89 let order_by = self
90 .order_by_kind
91 .as_ref()
92 .map(|order_by_kind| ast::OrderBy {
93 kind: order_by_kind.clone(),
94 interpolate: None,
95 });
96
97 Ok(ast::Query {
98 with: self.with.clone(),
99 body: match self.body {
100 Some(ref value) => value.clone(),
101 None => return Err(Into::into(UninitializedFieldError::from("body"))),
102 },
103 order_by,
104 limit_clause: Some(LimitClause::LimitOffset {
105 limit: self.limit.clone(),
106 offset: self.offset.clone(),
107 limit_by: self.limit_by.clone(),
108 }),
109 fetch: self.fetch.clone(),
110 locks: self.locks.clone(),
111 for_clause: self.for_clause.clone(),
112 settings: None,
113 format_clause: None,
114 pipe_operators: vec![],
115 })
116 }
117 fn create_empty() -> Self {
118 Self {
119 with: Default::default(),

Calls 11

intoFunction · 0.85
newFunction · 0.85
ExprEnum · 0.85
emptyFunction · 0.50
ValueEnum · 0.50
mapMethod · 0.45
as_refMethod · 0.45
cloneMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45
intoMethod · 0.45