Class

org.apache.spark.sql.catalyst.trees

TreeNode

Related Doc: package trees

Permalink

abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product

Self Type
BaseType
Linear Supertypes
Product, Equals, AnyRef, Any
Known Subclasses
Abs, Acos, Add, AddMonths, Aggregate, AggregateExpression, AggregateFunction, AggregateWindowFunction, Alias, And, AppendColumns, AppendColumnsWithObject, ApproximatePercentile, ArrayContains, Ascii, Asin, AssertNotNull, AssertTrue, AtLeastNNonNulls, Atan, Atan2, Attribute, AttributeReference, Average, BRound, Base64, Bin, BinaryArithmetic, BinaryComparison, BinaryExpression, BinaryMathExpression, BinaryNode, BinaryOperator, BitwiseAnd, BitwiseNot, BitwiseOr, BitwiseXor, BoundReference, BroadcastHint, CallMethodViaReflection, CaseWhen, CaseWhenBase, CaseWhenCodegen, Cast, Cbrt, Ceil, CentralMomentAgg, CheckOverflow, CoGroup, Coalesce, CodegenFallback, Collect, CollectList, CollectSet, Command, Concat, ConcatWs, Contains, Conv, Corr, Cos, Cosh, Count, CovPopulation, CovSample, Covariance, Crc32, CreateArray, CreateExternalRow, CreateMap, CreateNamedStruct, CreateNamedStructLike, CreateNamedStructUnsafe, Cube, CumeDist, CurrentBatchTimestamp, CurrentDatabase, CurrentDate, CurrentTimestamp, DateAdd, DateDiff, DateFormatClass, DateSub, DayOfMonth, DayOfYear, DeclarativeAggregate, Decode, DecodeUsingSerializer, DenseRank, DeserializeToObject, Distinct, Divide, Elt, Encode, EncodeUsingSerializer, EndsWith, EqualNullSafe, EqualTo, EulerNumber, EventTimeWatermark, Except, Exists, Exp, Expand, ExpectsInputTypes, Explode, ExplodeBase, Expm1, Expression, ExternalMapToCatalyst, ExtractValue, Factorial, Filter, FindInSet, First, FlatMapGroupsInR, Floor, FormatNumber, FormatString, FromUTCTimestamp, FromUnixTime, Generate, Generator, GetArrayItem, GetArrayStructFields, GetColumnByOrdinal, GetExternalRowField, GetJsonObject, GetMapValue, GetStructField, GlobalLimit, GreaterThan, GreaterThanOrEqual, Greatest, Grouping, GroupingID, GroupingSet, GroupingSets, HashExpression, HashPartitioning, Hex, HiveHash, Hour, HyperLogLogPlusPlus, Hypot, If, IfNull, ImperativeAggregate, ImplicitCastInputTypes, In, InSet, InitCap, InitializeJavaBean, Inline, InputFileName, InsertIntoTable, Intersect, Invoke, InvokeLike, IsNaN, IsNotNull, IsNull, Join, JsonToStruct, JsonTuple, Kurtosis, Lag, LambdaVariable, Last, LastDay, Lead, LeafExpression, LeafMathExpression, LeafNode, Least, Length, LessThan, LessThanOrEqual, Levenshtein, Like, ListQuery, Literal, LocalLimit, LocalRelation, Log, Log10, Log1p, Log2, Logarithm, LogicalPlan, Lower, MakeDecimal, MapElements, MapGroups, MapKeys, MapObjects, MapPartitions, MapPartitionsInR, MapValues, Max, Md5, Min, Minute, MonotonicallyIncreasingID, Month, MonthsBetween, MultiAlias, Multiply, Murmur3Hash, NTile, NaNvl, NamePlaceholder, NamedExpression, NewInstance, NextDay, NoOp, NonSQLExpression, Nondeterministic, Not, NullIf, Nvl, Nvl2, ObjectConsumer, ObjectProducer, OffsetWindowFunction, OneRowRelation, Or, OuterReference, ParseUrl, PartitioningCollection, PercentRank, Percentile, Pi, Pivot, PivotFirst, PlanExpression, Pmod, PosExplode, Pow, PreciseTimestamp, Predicate, PredicateSubquery, PrettyAttribute, PrintToStderr, Project, PromotePrecision, Quarter, QueryPlan, RDG, RLike, Rand, Randn, Range, RangePartitioning, Rank, RankLike, ReferenceToExpressions, RegExpExtract, RegExpReplace, Remainder, Repartition, RepartitionByExpression, ResolvedStar, ReturnAnswer, Rint, Rollup, Round, RoundBase, RowNumber, RowNumberLike, RuntimeReplaceable, Sample, ScalaUDF, ScalarSubquery, ScriptTransformation, Second, Sentences, SerializeFromObject, SetOperation, Sha1, Sha2, ShiftLeft, ShiftRight, ShiftRightUnsigned, Signum, SimpleCatalogRelation, Sin, Sinh, Size, SizeBasedWindowFunction, Skewness, Sort, SortArray, SortOrder, SortPrefix, SoundEx, SparkPartitionID, Sqrt, Stack, Star, StartsWith, StaticInvoke, StddevPop, StddevSamp, String2StringExpression, StringInstr, StringLPad, StringLocate, StringPredicate, StringRPad, StringRegexExpression, StringRepeat, StringReverse, StringSpace, StringSplit, StringToMap, StringTranslate, StringTrim, StringTrimLeft, StringTrimRight, StructToJson, Subquery, SubqueryAlias, SubqueryExpression, Substring, SubstringIndex, Subtract, Sum, Tan, Tanh, TernaryExpression, TimeAdd, TimeSub, TimeWindow, ToDate, ToDegrees, ToRadians, ToUTCTimestamp, ToUnixTimestamp, TruncDate, TypedFilter, TypedImperativeAggregate, UnBase64, UnaryExpression, UnaryLogExpression, UnaryMathExpression, UnaryMinus, UnaryNode, UnaryPositive, Unevaluable, Unhex, Union, UnixTime, UnixTimestamp, UnresolvedAlias, UnresolvedAttribute, UnresolvedDeserializer, UnresolvedExtractValue, UnresolvedFunction, UnresolvedGenerator, UnresolvedInlineTable, UnresolvedOrdinal, UnresolvedRelation, UnresolvedStar, UnresolvedTableValuedFunction, UnresolvedWindowExpression, UnscaledValue, UnwrapOption, UpCast, Upper, UserDefinedGenerator, ValidateExternalType, VariancePop, VarianceSamp, WeekOfYear, Window, WindowExpression, WindowFunction, WindowSpecDefinition, With, WithWindowDefinition, WrapOption, XPathBoolean, XPathDouble, XPathExtract, XPathFloat, XPathInt, XPathList, XPathLong, XPathShort, XPathString, XxHash64, Year
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TreeNode
  2. Product
  3. Equals
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TreeNode()

    Permalink

Abstract Value Members

  1. abstract def canEqual(that: Any): Boolean

    Permalink
    Definition Classes
    Equals
  2. abstract def children: Seq[BaseType]

    Permalink

    Returns a Seq of the children of this node.

    Returns a Seq of the children of this node. Children should not change. Immutability required for containsChild optimization

  3. abstract def productArity: Int

    Permalink
    Definition Classes
    Product
  4. abstract def productElement(n: Int): Any

    Permalink
    Definition Classes
    Product
  5. abstract def verboseString: String

    Permalink

    ONE line description of this node with more information

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(number: Int): TreeNode[_]

    Permalink

    Returns the tree node at the specified number, used primarily for interactive debugging.

    Returns the tree node at the specified number, used primarily for interactive debugging. Numbers for each node can be found in the numberedTreeString.

    Note that this cannot return BaseType because logical plan's plan node might return physical plan for innerChildren, e.g. in-memory relation logical plan node has a reference to the physical plan node it is referencing.

  5. def argString: String

    Permalink

    Returns a string representing the arguments to this node, minus any children

  6. def asCode: String

    Permalink

    Returns a 'scala code' representation of this TreeNode and its children.

    Returns a 'scala code' representation of this TreeNode and its children. Intended for use when debugging where the prettier toString function is obfuscating the actual structure. In the case of 'pure' TreeNodes that only contain primitives and other TreeNodes, the result can be pasted in the REPL to build an equivalent Tree.

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collect[B](pf: PartialFunction[BaseType, B]): Seq[B]

    Permalink

    Returns a Seq containing the result of applying a partial function to all elements in this tree on which the function is defined.

  10. def collectFirst[B](pf: PartialFunction[BaseType, B]): Option[B]

    Permalink

    Finds and returns the first TreeNode of the tree for which the given partial function is defined (pre-order), and applies the partial function to it.

  11. def collectLeaves(): Seq[BaseType]

    Permalink

    Returns a Seq containing the leaves in this tree.

  12. lazy val containsChild: Set[TreeNode[_]]

    Permalink
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def fastEquals(other: TreeNode[_]): Boolean

    Permalink

    Faster version of equality which short-circuits when two treeNodes are the same instance.

    Faster version of equality which short-circuits when two treeNodes are the same instance. We don't just override Object.equals, as doing so prevents the scala compiler from generating case class equals methods

  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def find(f: (BaseType) ⇒ Boolean): Option[BaseType]

    Permalink

    Find the first TreeNode that satisfies the condition specified by f.

    Find the first TreeNode that satisfies the condition specified by f. The condition is recursively applied to this node and all of its children (pre-order).

  18. def flatMap[A](f: (BaseType) ⇒ TraversableOnce[A]): Seq[A]

    Permalink

    Returns a Seq by applying a function to all nodes in this tree and using the elements of the resulting collections.

  19. def foreach(f: (BaseType) ⇒ Unit): Unit

    Permalink

    Runs the given function on this node and then recursively on children.

    Runs the given function on this node and then recursively on children.

    f

    the function to be applied to each node in the tree.

  20. def foreachUp(f: (BaseType) ⇒ Unit): Unit

    Permalink

    Runs the given function recursively on children then on this node.

    Runs the given function recursively on children then on this node.

    f

    the function to be applied to each node in the tree.

  21. def generateTreeString(depth: Int, lastChildren: Seq[Boolean], builder: StringBuilder, verbose: Boolean, prefix: String = ""): StringBuilder

    Permalink

    Appends the string represent of this node and its children to the given StringBuilder.

    Appends the string represent of this node and its children to the given StringBuilder.

    The i-th element in lastChildren indicates whether the ancestor of the current node at depth i + 1 is the last child of its own parent node. The depth of the root node is 0, and lastChildren for the root node should be empty.

    Note that this traversal (numbering) order must be the same as getNodeNumbered.

  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Permalink
    Definition Classes
    TreeNode → AnyRef → Any
  24. def innerChildren: Seq[TreeNode[_]]

    Permalink

    All the nodes that should be shown as a inner nested tree of this node.

    All the nodes that should be shown as a inner nested tree of this node. For example, this can be used to show sub-queries.

    Attributes
    protected
  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. def jsonFields: List[JField]

    Permalink
    Attributes
    protected
  27. def makeCopy(newArgs: Array[AnyRef]): BaseType

    Permalink

    Creates a copy of this type of tree node after a transformation.

    Creates a copy of this type of tree node after a transformation. Must be overridden by child classes that have constructor arguments that are not present in the productIterator.

    newArgs

    the new product arguments.

  28. def map[A](f: (BaseType) ⇒ A): Seq[A]

    Permalink

    Returns a Seq containing the result of applying the given function to each node in this tree in a preorder traversal.

    Returns a Seq containing the result of applying the given function to each node in this tree in a preorder traversal.

    f

    the function to be applied.

  29. def mapChildren(f: (BaseType) ⇒ BaseType): BaseType

    Permalink

    Returns a copy of this node where f has been applied to all the nodes children.

  30. def mapProductIterator[B](f: (Any) ⇒ B)(implicit arg0: ClassTag[B]): Array[B]

    Permalink

    Efficient alternative to productIterator.map(f).toArray.

    Efficient alternative to productIterator.map(f).toArray.

    Attributes
    protected
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. def nodeName: String

    Permalink

    Returns the name of this type of TreeNode.

    Returns the name of this type of TreeNode. Defaults to the class name. Note that we remove the "Exec" suffix for physical operators here.

  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. def numberedTreeString: String

    Permalink

    Returns a string representation of the nodes in this tree, where each operator is numbered.

    Returns a string representation of the nodes in this tree, where each operator is numbered. The numbers can be used with TreeNode.apply to easily access specific subtrees.

    The numbers are based on depth-first traversal of the tree (with innerChildren traversed first before children).

  36. val origin: Origin

    Permalink
  37. def otherCopyArgs: Seq[AnyRef]

    Permalink

    Args to the constructor that should be copied, but not transformed.

    Args to the constructor that should be copied, but not transformed. These are appended to the transformed args automatically by makeCopy

    Attributes
    protected
  38. def p(number: Int): BaseType

    Permalink

    Returns the tree node at the specified number, used primarily for interactive debugging.

    Returns the tree node at the specified number, used primarily for interactive debugging. Numbers for each node can be found in the numberedTreeString.

    This is a variant of apply that returns the node as BaseType (if the type matches).

  39. def prettyJson: String

    Permalink
  40. def productIterator: Iterator[Any]

    Permalink
    Definition Classes
    Product
  41. def productPrefix: String

    Permalink
    Definition Classes
    Product
  42. def simpleString: String

    Permalink

    ONE line description of this node.

  43. def stringArgs: Iterator[Any]

    Permalink

    The arguments that should be included in the arg string.

    The arguments that should be included in the arg string. Defaults to the productIterator.

    Attributes
    protected
  44. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  45. def toJSON: String

    Permalink
  46. def toString(): String

    Permalink
    Definition Classes
    TreeNode → AnyRef → Any
  47. def transform(rule: PartialFunction[BaseType, BaseType]): BaseType

    Permalink

    Returns a copy of this node where rule has been recursively applied to the tree.

    Returns a copy of this node where rule has been recursively applied to the tree. When rule does not apply to a given node it is left unchanged. Users should not expect a specific directionality. If a specific directionality is needed, transformDown or transformUp should be used.

    rule

    the function use to transform this nodes children

  48. def transformDown(rule: PartialFunction[BaseType, BaseType]): BaseType

    Permalink

    Returns a copy of this node where rule has been recursively applied to it and all of its children (pre-order).

    Returns a copy of this node where rule has been recursively applied to it and all of its children (pre-order). When rule does not apply to a given node it is left unchanged.

    rule

    the function used to transform this nodes children

  49. def transformUp(rule: PartialFunction[BaseType, BaseType]): BaseType

    Permalink

    Returns a copy of this node where rule has been recursively applied first to all of its children and then itself (post-order).

    Returns a copy of this node where rule has been recursively applied first to all of its children and then itself (post-order). When rule does not apply to a given node, it is left unchanged.

    rule

    the function use to transform this nodes children

  50. def treeString(verbose: Boolean): String

    Permalink
  51. def treeString: String

    Permalink

    Returns a string representation of the nodes in this tree

  52. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. def withNewChildren(newChildren: Seq[BaseType]): BaseType

    Permalink

    Returns a copy of this node with the children replaced.

    Returns a copy of this node with the children replaced. TODO: Validate somewhere (in debug mode?) that children are ordered correctly.

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped