Skip to content

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

Closed
Ngone51 wants to merge 1 commit intoapache:masterfrom
Ngone51:fix-codeformatter-for-multi-comment-lines
Closed

[SPARK-27193][SQL] CodeFormatter should format multiple comment lines correctly#24133
Ngone51 wants to merge 1 commit intoapache:masterfrom
Ngone51:fix-codeformatter-for-multi-comment-lines

Conversation

@Ngone51
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Ngone51 commented Mar 18, 2019

ping @cloud-fan @mgaido91 @sameeragarwal

Can you have a look at this ? Thanks.

@mgaido91
Copy link
Copy Markdown
Contributor

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

@SparkQA
Copy link
Copy Markdown

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
Copy Markdown
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in a8af23d Mar 19, 2019
@Ngone51
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

4 participants