Github user markusb79 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16648#discussion_r105500528
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/MonotonicallyIncreasingID.scala
 ---
    @@ -67,14 +67,15 @@ case class MonotonicallyIncreasingID() extends 
LeafExpression with Nondeterminis
       override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
         val countTerm = ctx.freshName("count")
         val partitionMaskTerm = ctx.freshName("partitionMask")
    -    ctx.addMutableState(ctx.JAVA_LONG, countTerm, "")
    -    ctx.addMutableState(ctx.JAVA_LONG, partitionMaskTerm, "")
    -    ctx.addPartitionInitializationStatement(s"$countTerm = 0L;")
    -    ctx.addPartitionInitializationStatement(s"$partitionMaskTerm = ((long) 
partitionIndex) << 33;")
    +    val countTermAccessor = ctx.addMutableState(ctx.JAVA_LONG, countTerm, 
"")
    +    val partitionMaskTermAccessor = ctx.addMutableState(ctx.JAVA_LONG, 
partitionMaskTerm, "")
    +    ctx.addPartitionInitializationStatement(s"$countTermAccessor = 0L;")
    +    ctx.addPartitionInitializationStatement(
    +      s"$partitionMaskTermAccessor = ((long) partitionIndex) << 33;")
     
         ev.copy(code = s"""
    -      final ${ctx.javaType(dataType)} ${ev.value} = $partitionMaskTerm + 
$countTerm;
    -      $countTerm++;""", isNull = "false")
    +      final ${ctx.javaType(dataType)} ${ev.value} = 
$partitionMaskTermAccessor + $countTermAccessor;
    +      $countTermAccessor++;""", isNull = "false")
    --- End diff --
    
    The Accessor suffixes to variable names add quite a bit of noise in this 
PR. What value do they add from your perspective?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to