Github user rednaxelafx commented on the issue:
https://github.com/apache/spark/pull/20419
@kiszk For this specific kind of usage, I don't think using a hardcoded
stable ID will be a problem.
The comment we're talking about is the kind the can only appear once in a
single whole-stage codegen unit -- there's only one `GeneratedIterator` class
with the `processNext()` method as the main entry point. Providing such a
mechanism allows codegen developers to mark important information without
risking to affect codegen cache behavior.
For safety, we can add a runtime check. Let's assume this new method is
called `ctx.registerCommentWithId()`, then inside this method we can implement
something very similar to `ctx.freshName()`, but instead of producing a new
name with a potential integer suffix appended, we can either log a warning
message or throw an exception. That way the developer would have an easy way to
catch this.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]