aokolnychyi commented on code in PR #40206:
URL: https://github.com/apache/spark/pull/40206#discussion_r1119509044
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -139,33 +139,46 @@ object TableOutputResolver {
private def resolveStructType(
input: NamedExpression,
inputType: StructType,
+ expectedCol: Attribute,
expectedType: StructType,
- expectedName: String,
conf: SQLConf,
addError: String => Unit,
colPath: Seq[String]): Option[NamedExpression] = {
val fields = inputType.zipWithIndex.map { case (f, i) =>
Alias(GetStructField(input, i, Some(f.name)), f.name)()
}
- val reordered = reorderColumnsByName(fields, expectedType.toAttributes,
conf, addError, colPath)
Review Comment:
Whenever we call `expectedType.toAttributes`, we ignore the raw type
information associated with the attribute. As a result, we never added length
checks when nested fields were resolved by name.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]