You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2016/03/30 23:13:25 UTC

[jira] [Commented] (SPARK-14282) CodeFormatter should handle oneline comment with /* */ properly

    [ https://issues.apache.org/jira/browse/SPARK-14282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15218876#comment-15218876 ] 

Apache Spark commented on SPARK-14282:
--------------------------------------

User 'dongjoon-hyun' has created a pull request for this issue:
https://github.com/apache/spark/pull/12072

> CodeFormatter should handle oneline comment with /* */ properly
> ---------------------------------------------------------------
>
>                 Key: SPARK-14282
>                 URL: https://issues.apache.org/jira/browse/SPARK-14282
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Dongjoon Hyun
>
> This issue improves `CodeFormatter` to fix the following cases.
> *Before*
> {code}
> /* 019 */   public java.lang.Object apply(java.lang.Object _i) {
> /* 020 */     InternalRow i = (InternalRow) _i;
> /* 021 */     /* createexternalrow(if (isnull(input[0, double])) null else input[0, double], if (isnull(input[1, int])) null else input[1, int], ... */
> /* 022 */       boolean isNull = false;
> /* 023 */       final Object[] values = new Object[2];
> /* 024 */       /* if (isnull(input[0, double])) null else input[0, double] */
> /* 025 */     /* isnull(input[0, double]) */
> ...
> /* 053 */     if (!false && false) {
> /* 054 */       /* null */
> /* 055 */     final int value9 = -1;
> /* 056 */     isNull6 = true;
> /* 057 */     value6 = value9;
> /* 058 */   } else {
> ...
> /* 077 */   return mutableRow;
> /* 078 */ }
> /* 079 */ }
> /* 080 */ 
> {code}
> *After*
> {code}
> /* 053 */     if (!false && false) {
> /* 054 */       /* null */
> /* 055 */       final int value9 = -1;
> /* 056 */       isNull6 = true;
> /* 057 */       value6 = value9;
> /* 058 */     } else {
> ...
> /* 019 */   public java.lang.Object apply(java.lang.Object _i) {
> /* 020 */     InternalRow i = (InternalRow) _i;
> /* 021 */     /* createexternalrow(if (isnull(input[0, double])) null else input[0, double], if (isnull(input[1, int])) null else input[1, int], ... */
> /* 022 */     boolean isNull = false;
> /* 023 */     final Object[] values = new Object[2];
> /* 024 */     /* if (isnull(input[0, double])) null else input[0, double] */
> /* 025 */     /* isnull(input[0, double]) */
> ...
> /* 077 */     return mutableRow;
> /* 078 */   }
> /* 079 */ }
> /* 080 */ 
> {code}
> Also, this issue fixes the following too. (Similar with SPARK-14185)
> *Before*
> {code}
> 16/03/30 12:39:24 DEBUG WholeStageCodegen: /* 001 */ public Object generate(Object[] references) {
> /* 002 */   return new GeneratedIterator(references);
> /* 003 */ }
> {code}
> *After*
> {code}
> 16/03/30 12:46:32 DEBUG WholeStageCodegen: 
> /* 001 */ public Object generate(Object[] references) {
> /* 002 */   return new GeneratedIterator(references);
> /* 003 */ }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org