Github user ericl commented on a diff in the pull request:
https://github.com/apache/spark/pull/13505#discussion_r65821205
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/package.scala
---
@@ -86,11 +86,31 @@ package object expressions {
/**
* Helper functions for working with `Seq[Attribute]`.
*/
- implicit class AttributeSeq(attrs: Seq[Attribute]) {
+ implicit class AttributeSeq(val attrs: Seq[Attribute]) {
/** Creates a StructType with a schema matching this `Seq[Attribute]`.
*/
def toStructType: StructType = {
StructType(attrs.map(a => StructField(a.name, a.dataType,
a.nullable)))
}
+
+ private lazy val inputArr = attrs.toArray
+
+ private lazy val inputToOrdinal = {
+ val map = new java.util.HashMap[ExprId, Int](inputArr.length * 2)
--- End diff --
+1 on withExpectedSize
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]