bersprockets commented on a change in pull request #35635:
URL: https://github.com/apache/spark/pull/35635#discussion_r840971543



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -3141,7 +3141,7 @@ class Analyzer(override val catalogManager: 
CatalogManager)
       // have been resolved.
       case p @ Project(projectList, child)
         if hasWindowFunction(projectList) && 
!p.expressions.exists(!_.resolved) =>
-        val (windowExpressions, regularExpressions) = extract(projectList)
+        val (windowExpressions, regularExpressions) = 
extract(projectList.toIndexedSeq)

Review comment:
       >shall we simply fix all the public APIs that take Seq, to always call 
toIndexedSeq
   
   I thought about that, and I think we should do that as well.
   
   Although right now, AFAIK, the only way to pass lazy data structures to 
these loops is through the public API, there are other paths to this code 
(e.g., the parser) and some future innocuous-seeming change might end up 
passing streams to these loops. For example, somebody might add code that uses 
`Javaconverters`:
   ```
   scala> jal
   res7: java.util.ArrayList[Integer] = [2]
   
   scala> jal.iterator.asScala.toSeq
   res8: Seq[Integer] = Stream(2, ?)
   
   scala> 
   ```




-- 
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]

Reply via email to