This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/main by this push:
     new 3b448e004 ORC-1530: Rename variables in 
`RecordReaderUtils.ChunkReader#create`
3b448e004 is described below

commit 3b448e004bd22e0cb8f71e18077f142a6535bc45
Author: yebukong <[email protected]>
AuthorDate: Tue Nov 28 09:26:33 2023 -0800

    ORC-1530: Rename variables in `RecordReaderUtils.ChunkReader#create`
    
    ### What changes were proposed in this pull request?
    
    rename variables in RecordReaderUtils.ChunkReader#create
    
    ### Why are the changes needed?
    
    for easy reading
    
    see [PR 
1662](https://github.com/apache/orc/pull/1662#discussion_r1404534922)
    
    ### How was this patch tested?
    
    Closes #1664 from yebukong/ORC-1528_rename_variables.
    
    Authored-by: yebukong <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../org/apache/orc/impl/RecordReaderUtils.java     | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java 
b/java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java
index 1b76f0d8b..d249a2cc2 100644
--- a/java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java
+++ b/java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java
@@ -770,32 +770,32 @@ public class RecordReaderUtils {
     }
 
     static ChunkReader create(BufferChunk from, BufferChunk to) {
-      long f = Long.MAX_VALUE;
-      long e = Long.MIN_VALUE;
+      long start = Long.MAX_VALUE;
+      long end = Long.MIN_VALUE;
 
-      long cf = Long.MAX_VALUE;
-      long ef = Long.MIN_VALUE;
+      long currentStart = Long.MAX_VALUE;
+      long currentEnd = Long.MIN_VALUE;
       long reqBytes = 0L;
 
       BufferChunk current = from;
       while (current != to.next) {
-        f = Math.min(f, current.getOffset());
-        e = Math.max(e, current.getEnd());
-        if (ef == Long.MIN_VALUE || current.getOffset() <= ef) {
-          cf = Math.min(cf, current.getOffset());
-          ef = Math.max(ef, current.getEnd());
+        start = Math.min(start, current.getOffset());
+        end = Math.max(end, current.getEnd());
+        if (currentEnd == Long.MIN_VALUE || current.getOffset() <= currentEnd) 
{
+          currentStart = Math.min(currentStart, current.getOffset());
+          currentEnd = Math.max(currentEnd, current.getEnd());
         } else {
-          reqBytes += ef - cf;
-          cf = current.getOffset();
-          ef = current.getEnd();
+          reqBytes += currentEnd - currentStart;
+          currentStart = current.getOffset();
+          currentEnd = current.getEnd();
         }
         current = (BufferChunk) current.next;
       }
-      reqBytes += ef - cf;
+      reqBytes += currentEnd - currentStart;
       if (reqBytes > IOUtils.MAX_ARRAY_SIZE) {
         throw new IllegalArgumentException("invalid reqBytes value " + 
reqBytes + ",out of bounds " + IOUtils.MAX_ARRAY_SIZE);
       }
-      long readBytes = e - f;
+      long readBytes = end - start;
       if (readBytes > IOUtils.MAX_ARRAY_SIZE) {
         throw new IllegalArgumentException("invalid readBytes value " + 
readBytes + ",out of bounds " + IOUtils.MAX_ARRAY_SIZE);
       }

Reply via email to