Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/19811#discussion_r154019257
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
---
@@ -168,6 +166,21 @@ class CodegenContext {
val mutableStates: mutable.ArrayBuffer[(String, String, String)] =
mutable.ArrayBuffer.empty[(String, String, String)]
+ // An array keyed by the tuple of mutable states' types and
initialization code, holds the
+ // current max index of the array
+ var mutableStateArrayIdx: mutable.Map[(String, String), Int] =
+ mutable.Map.empty[(String, String), Int]
+
+ // An array keyed by the tuple of mutable states' types and
initialization code, holds the
+ // current name of the mutableStateArray into which state of the given
key will be compacted
+ var mutableStateArrayCurrentNames: mutable.Map[(String, String), String]
=
+ mutable.Map.empty[(String, String), String]
+
+ // An array keyed by the tuple of mutable states' types, array names and
initialization code,
+ // holds the code that will initialize the mutableStateArray when
initialized in loops
+ var mutableStateArrayInitCodes: mutable.ArrayBuffer[(String, String,
String)] =
--- End diff --
It is OK to use an array since this is not looked up. This is used only for
generating code.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]