Skip to content

Commit

Permalink
[MINOR][SQL] Some errors in the notes.
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

When using ordinals to access linked list, the time cost is O(n).

## How was this patch tested?

Existing tests.

Closes apache#23280 from CarolinePeng/update_Two.

Authored-by: CarolinPeng <00244106@zte.intra>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
  • Loading branch information
CarolinPeng authored and holdenk committed Jan 5, 2019
1 parent e3b1790 commit 736df41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ package object expressions {
StructType(attrs.map(a => StructField(a.name, a.dataType, a.nullable, a.metadata)))
}

// It's possible that `attrs` is a linked list, which can lead to bad O(n^2) loops when
// It's possible that `attrs` is a linked list, which can lead to bad O(n) loops when
// accessing attributes by their ordinals. To avoid this performance penalty, convert the input
// to an array.
@transient private lazy val attrsArray = attrs.toArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ abstract class LogicalPlan
/**
* Optionally resolves the given strings to a [[NamedExpression]] using the input from all child
* nodes of this LogicalPlan. The attribute is expressed as
* as string in the following form: `[scope].AttributeName.[nested].[fields]...`.
* string in the following form: `[scope].AttributeName.[nested].[fields]...`.
*/
def resolveChildren(
nameParts: Seq[String],
Expand Down

0 comments on commit 736df41

Please sign in to comment.