Skip to content

Commit d25e443

Browse files
CarolinPengsrowen
authored andcommitted
[MINOR][SQL] Some errors in the notes.
## 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 #23280 from CarolinePeng/update_Two. Authored-by: CarolinPeng <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 3dda58a commit d25e443

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ package object expressions {
101101
StructType(attrs.map(a => StructField(a.name, a.dataType, a.nullable, a.metadata)))
102102
}
103103

104-
// It's possible that `attrs` is a linked list, which can lead to bad O(n^2) loops when
104+
// It's possible that `attrs` is a linked list, which can lead to bad O(n) loops when
105105
// accessing attributes by their ordinals. To avoid this performance penalty, convert the input
106106
// to an array.
107107
@transient private lazy val attrsArray = attrs.toArray

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ abstract class LogicalPlan
9393
/**
9494
* Optionally resolves the given strings to a [[NamedExpression]] using the input from all child
9595
* nodes of this LogicalPlan. The attribute is expressed as
96-
* as string in the following form: `[scope].AttributeName.[nested].[fields]...`.
96+
* string in the following form: `[scope].AttributeName.[nested].[fields]...`.
9797
*/
9898
def resolveChildren(
9999
nameParts: Seq[String],

0 commit comments

Comments
 (0)