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_r244777939
##########
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:
I was thinking that just because exprs is empty, that would not necessarily
mean inputSchema is empty. But experiments seem to indicate that inputSchema is
also empty. So building the AttributeSeq would be extremely low-cost. I guess
there is no reason to lazily build it.
----------------------------------------------------------------
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]