risingwave_expr::expr::build

Function build_from_pretty

source
pub fn build_from_pretty(s: impl AsRef<str>) -> BoxedExpression
Expand description

Build an expression from a string.

§Example

build_from_pretty("42:int2"); // literal
build_from_pretty("$0:int8"); // inputref
build_from_pretty("(add:int8 42:int2 $1:int8)"); // function
build_from_pretty("(add:int8 42:int2 (add:int8 42:int2 $1:int8))");

§Syntax

<expr>      ::= <literal> | <input_ref> | <function>
<literal>   ::= <value>:<type>
<input_ref> ::= <index>:<type>
<function>  ::= (<name>:<type> <expr>...)
<name>      ::= [a-zA-Z_][a-zA-Z0-9_]*
<index>     ::= $[0-9]+