maropu commented on issue #28041: [SPARK-30564][SQL] Improved extra new line and comment remove URL: https://github.com/apache/spark/pull/28041#issuecomment-612755145 > Pretty big amount of the source code we currently generate is comment or extra whitespace/newline. If so, how about defining a more light-weight logic to count the #characters in code blocks like this https://github.com/apache/spark/compare/master...maropu:SPARK-30564 ? I looked over the existing comments on generated code and it seems most comments have simple forms like this; ``` // comments public void someMethod() { // comments some code; // comments } ``` So, I think we don't need full-fledged functionality to remove generated comments. Also, `CodeFormatter` is for [debugging purpose](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeFormatter.scala#L24) and I think `Block.length` should not depend on the class. When we need to add complicated comments (e.g., multi-line comments with `/* ... */`), I think they should come with `CodegenContext.registerComment`.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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]
