@@ -189,7 +189,7 @@ private[catalyst] class AttributeResolver(attributes: Seq[Attribute]) extends Lo
189189 }
190190
191191 /** Map to use for direct case insensitive attribute lookups. */
192- private val direct : Map [String , Seq [Attribute ]] = {
192+ private lazy val direct : Map [String , Seq [Attribute ]] = {
193193 unique(attributes.groupBy(_.name.toLowerCase))
194194 }
195195
@@ -214,7 +214,7 @@ private[catalyst] class AttributeResolver(attributes: Seq[Attribute]) extends Lo
214214 // and "c" is the struct field name, i.e. "a.b.c". In this case, Attribute will be "a.b",
215215 // and the second element will be List("c").
216216 val matches = nameParts match {
217- case qualifier :: name : : nestedFields =>
217+ case qualifier +: name + : nestedFields =>
218218 val key = (qualifier.toLowerCase, name.toLowerCase)
219219 val attributes = qualified.get(key).toSeq.flatMap(_.filter { a =>
220220 resolver(qualifier, a.qualifier.get) && isMatch(name, a)
@@ -226,7 +226,7 @@ private[catalyst] class AttributeResolver(attributes: Seq[Attribute]) extends Lo
226226
227227 // If none of attributes match `table.column` pattern, we try to resolve it as a column.
228228 val (candidates, nestedFields) = matches match {
229- case (Nil , _) =>
229+ case (Seq () , _) =>
230230 val name = nameParts.head
231231 val attributes = direct.get(name.toLowerCase).toSeq.flatMap(_.filter(isMatch(name, _)))
232232 (attributes, nameParts.tail)
0 commit comments