cloud-fan commented on a change in pull request #27350: [SPARK-30615][SQL]
Introduce Analyzer rule for V2 AlterTable column change resolution
URL: https://github.com/apache/spark/pull/27350#discussion_r372925741
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala
##########
@@ -308,52 +310,74 @@ case class StructType(fields: Array[StructField])
extends DataType with Seq[Stru
}
/**
- * Returns a field in this struct and its child structs.
+ * Returns the normalized path to a field and the field in this struct and
its child structs.
*
* If includeCollections is true, this will return fields that are nested in
maps and arrays.
*/
private[sql] def findNestedField(
fieldNames: Seq[String],
- includeCollections: Boolean = false): Option[StructField] = {
- fieldNames.headOption.flatMap(nameToField.get) match {
- case Some(field) =>
- (fieldNames.tail, field.dataType, includeCollections) match {
- case (Seq(), _, _) =>
- Some(field)
+ includeCollections: Boolean = false,
+ resolver: Resolver = _ == _): Option[(Seq[String], StructField)] = {
+ def prettyFieldName(nameParts: Seq[String]): String = {
Review comment:
can we reuse `CatalogV2Implicits.MultipartIdentifierHelper.quoted` ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]