Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27193

CodeFormatter should format multi comment lines correctly

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 2.4.0
    • 3.0.0
    • SQL
    • None

    Description

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

       
      Generated code:
      /* 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 {

      Attachments

        Issue Links

          Activity

            People

              Ngone51 wuyi
              Ngone51 wuyi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: