Skip to content

Commit b1ac505

Browse files
committed
Rename path to fieldNames.
1 parent 8463c73 commit b1ac505

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

sql/catalyst/src/main/java/org/apache/spark/sql/catalog/v2/util/CatalogV2Util.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,21 @@ object CatalogV2Util {
122122

123123
private def replace(
124124
struct: StructType,
125-
path: Seq[String],
125+
fieldNames: Seq[String],
126126
update: StructField => Option[StructField]): StructType = {
127127

128-
val pos = struct.getFieldIndex(path.head)
129-
.getOrElse(throw new IllegalArgumentException(s"Cannot find field: ${path.head}"))
128+
val pos = struct.getFieldIndex(fieldNames.head)
129+
.getOrElse(throw new IllegalArgumentException(s"Cannot find field: ${fieldNames.head}"))
130130
val field = struct.fields(pos)
131-
val replacement: Option[StructField] = if (path.tail.isEmpty) {
131+
val replacement: Option[StructField] = if (fieldNames.tail.isEmpty) {
132132
update(field)
133133
} else {
134134
field.dataType match {
135135
case nestedStruct: StructType =>
136-
val updatedType: StructType = replace(nestedStruct, path.tail, update)
136+
val updatedType: StructType = replace(nestedStruct, fieldNames.tail, update)
137137
Some(StructField(field.name, updatedType, field.nullable, field.metadata))
138138
case _ =>
139-
throw new IllegalArgumentException(s"Not a struct: ${path.head}")
139+
throw new IllegalArgumentException(s"Not a struct: ${fieldNames.head}")
140140
}
141141
}
142142

0 commit comments

Comments
 (0)