Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-27193][SQL] CodeFormatter should format multiple comment lines correctly #24133

Conversation

Ngone51
Copy link
Member

@Ngone51 Ngone51 commented Mar 18, 2019

What changes were proposed in this pull request?

when enable spark.sql.codegen.comments, there will be multiple comment lines. However, CodeFormatter can not handle multiple comment lines currently:

/* 001 */ public Object generate(Object[] references) {
/* 002 */   return new GeneratedIteratorForCodegenStage1(references);
/* 003 */ }
/* 004 */
/* 005 */ /**
 * Codegend pipeline for stage (id=1)
 * *(1) Project [(id#0L + 1) AS (id + 1)#3L]
 * +- *(1) Filter (id#0L = 1)
 *    +- *(1) Range (0, 10, step=1, splits=4)
 */
/* 006 */ // codegenStageId=1
/* 007 */ final class GeneratedIteratorForCodegenStage1 extends org.apache.spark.sql.execution.BufferedRowIterator {

After applying this pr:

/* 001 */ public Object generate(Object[] references) {
/* 002 */   return new GeneratedIteratorForCodegenStage1(references);
/* 003 */ }
/* 004 */
/* 005 */ /**
/* 006 */  * Codegend pipeline for stage (id=1)
/* 007 */  * *(1) Project [(id#0L + 1) AS (id + 1)#4L]
/* 008 */  * +- *(1) Filter (id#0L = 1)
/* 009 */  *    +- *(1) Range (0, 10, step=1, splits=2)
/* 010 */  */
/* 011 */ // codegenStageId=1
/* 012 */ final class GeneratedIteratorForCodegenStage1 extends org.apache.spark.sql.execution.BufferedRowIterator {

How was this patch tested?

Tested Manually.

@Ngone51
Copy link
Member Author

Ngone51 commented Mar 18, 2019

ping @cloud-fan @mgaido91 @sameeragarwal

Can you have a look at this ? Thanks.

@mgaido91
Copy link
Contributor

Not a big deal, but the change makes sense to me.

@SparkQA
Copy link

SparkQA commented Mar 18, 2019

Test build #103607 has finished for PR 24133 at commit 71cb419.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in a8af23d Mar 19, 2019
@Ngone51
Copy link
Member Author

Ngone51 commented Mar 19, 2019

thank you @mgaido91 @cloud-fan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants