Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19797#discussion_r153185397
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
---
@@ -173,6 +173,23 @@ class CodegenContext {
mutableStates += ((javaType, variableName, initCode))
}
+ /**
+ * Add a mutable state as a field to the generated class if the name has
not been added
+ *
+ * @param javaType Java type of the field.
+ * @param variableName Name of the field.
+ * @param initCode The statement(s) to put into the init() method to
initialize this field.
+ * If left blank, the field will be default-initialized.
+ */
+ def reuseOrAddMutableState(
--- End diff --
let's not do this, it's too hacky and error-prone. We should just create
the object every time, or create global variable every time.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]