public class NamedExpr extends UnaryOperator
NamedExpr
is an expression which can be aliased in a target list.
SELECT col1 + col2 as a, sum(col2) as b, col3 as c, col4, ... FROM ... ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^ expr1 expr2 expr3 expr4We define each expression in expr1 - expr4 as a named expression. In database community, each of them is called target or an expression in a select list, Each expression can be explicitly aliased as an given name.
Constructor and Description |
---|
NamedExpr(Expr expr) |
NamedExpr(Expr expr,
String alias) |
Modifier and Type | Method and Description |
---|---|
boolean |
equalsTo(Expr obj)
This method only compares this Expr contents with those of another Expr.
|
String |
getAlias() |
Expr |
getExpr() |
boolean |
hasAlias() |
int |
hashCode() |
void |
setAlias(String alias) |
String |
toJson() |
String |
toString() |
getChild, hasChild, setChild
public NamedExpr(Expr expr)
public Expr getExpr()
public boolean hasAlias()
public String getAlias()
public void setAlias(String alias)
public int hashCode()
hashCode
in class UnaryOperator
public boolean equalsTo(Expr obj)
Expr
obj
- The Expr instance to be compared.public String toJson()
toJson
in interface JsonSerializable
toJson
in class Expr
Copyright © 2014 Apache Software Foundation. All Rights Reserved.