RecursionTree

class RecursionTree(astType: String, value: String?, attrOfParent: String?, children: List<RecursionTree>?)

PIG AST is not a recursive data structure, thus it is not easy to transform it directly to a pretty printed string. So we need to first transform it into RecursionTree, which is a recursive tree structure (it has a list of children which are also RecursionTree), then we can recursively pretty print the RecursionTree as we want.

Parameters

astType

is a string of the PIG AST node type

value

is the value in case node type is PartiqlAst.Expr.Lit

attrOfParent

is a string which represents which attribute it belongs to its parent

children

is a list of child RecursionTree

Take the PartiqlAst.Expr.Eq node in the WHERE clause in SELECT a FROM b WHERE c = d as example. astType is '=', value is null, attrOfParent is 'where', children is a list of PartiqlAst.Expr.Id c and d.

Constructors

Link copied to clipboard
fun RecursionTree(astType: String, value: String? = null, attrOfParent: String? = null, children: List<RecursionTree>? = null)

Functions

Link copied to clipboard
fun convertToString(): String