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

Method alias_if_changed

datafusion/expr/src/expr.rs:1776–1783  ·  view source on GitHub ↗

Ensure `expr` has the name as `original_name` by adding an alias if necessary.

(self, original_name: String)

Source from the content-addressed store, hash-verified

1774 /// Ensure `expr` has the name as `original_name` by adding an
1775 /// alias if necessary.
1776 pub fn alias_if_changed(self, original_name: String) -> Result<Expr> {
1777 let new_name = self.name_for_alias()?;
1778 if new_name == original_name {
1779 return Ok(self);
1780 }
1781
1782 Ok(self.alias(original_name))
1783 }
1784
1785 /// Return `self AS name` alias expression
1786 pub fn alias(self, name: impl Into<String>) -> Expr {

Callers 3

rename_expressionsFunction · 0.80

Calls 2

name_for_aliasMethod · 0.80
aliasMethod · 0.45

Tested by

no test coverage detected