bersprockets commented on a change in pull request #23392: [SPARK-26450][SQL] 
Avoid rebuilding map of schema for every column in projection
URL: https://github.com/apache/spark/pull/23392#discussion_r244756738
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/package.scala
 ##########
 @@ -88,8 +88,11 @@ package object expressions  {
   /**
    * A helper function to bind given expressions to an input schema.
    */
-  def toBoundExprs(exprs: Seq[Expression], inputSchema: Seq[Attribute]): 
Seq[Expression] = {
-    exprs.map(BindReferences.bindReference(_, inputSchema))
+  def toBoundExprs[A <: Expression](
+    exprs: Seq[A],
+    inputSchema: Seq[Attribute]): Seq[A] = {
 
 Review comment:
   Sometimes this function is called with a zero-length exprs (```df.count```, 
for example). I am attempting to avoid constructing the AttributeSeq in that 
case, because AttributeSeq's constructor eagerly builds a data structure based 
on the attributes (```private val qualified3Part```).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]

Reply via email to