drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject [1/6] drill git commit: DRILL-4746: Verification Failures (Decimal values) in drill's regression tests.
Date Sat, 23 Jul 2016 04:58:41 GMT
Repository: drill
Updated Branches:
  refs/heads/master 1f3c74dad -> 5a7d4c398


DRILL-4746: Verification Failures (Decimal values) in drill's regression tests.

This closes #545


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/5ca2340a
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/5ca2340a
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/5ca2340a

Branch: refs/heads/master
Commit: 5ca2340a0a83412aa8fc8b077b72eca5f55e4226
Parents: 1f3c74d
Author: Arina Ielchiieva <arina.yelchiyeva@gmail.com>
Authored: Wed Jul 13 13:44:27 2016 +0300
Committer: Parth Chandra <parthc@apache.org>
Committed: Fri Jul 22 21:28:07 2016 -0700

----------------------------------------------------------------------
 .../store/easy/text/compliant/TextInput.java    | 50 ++++++--------------
 1 file changed, 14 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/5ca2340a/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/TextInput.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/TextInput.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/TextInput.java
index d8b1672..1bb2d30 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/TextInput.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/TextInput.java
@@ -17,22 +17,6 @@
  */
 package org.apache.drill.exec.store.easy.text.compliant;
 
-/*******************************************************************************
- * Copyright 2014 uniVocity Software Pty Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-
 import io.netty.buffer.DrillBuf;
 import io.netty.util.internal.PlatformDependent;
 
@@ -188,7 +172,7 @@ final class TextInput {
    * read some more bytes from the stream.  Uses the zero copy interface if available.  Otherwise,
does byte copy.
    * @throws IOException
    */
-  private final void read() throws IOException {
+  private void read() throws IOException {
     if(bufferReadable){
 
       if(remByte != -1){
@@ -219,7 +203,7 @@ final class TextInput {
    * Read more data into the buffer.  Will also manage split end conditions.
    * @throws IOException
    */
-  private final void updateBuffer() throws IOException {
+  private void updateBuffer() throws IOException {
     streamPos = seekable.getPos();
     underlyingBuffer.clear();
 
@@ -249,30 +233,24 @@ final class TextInput {
    * the split boundary.
    */
   private void updateLengthBasedOnConstraint() {
-    // find the next line separator:
     final long max = bStart + length;
-
-    for (long m = this.bStart + (endPos - streamPos); m < max; m++) {
-      long mTemp = m - 1;
+    for(long m = bStart + (endPos - streamPos); m < max; m++) {
       for (int i = 0; i < lineSeparator.length; i++) {
-        mTemp++;
-        if (PlatformDependent.getByte(mTemp) == lineSeparator[i]) {
-          if (mTemp < max) {
-            continue;
-          } else {
-            // remnant bytes
-            // the last N characters of the read were a remnant bytes. We'll hold off on
dealing with these bytes until the next read.
-            remByte = i;
-            length -= (i + 1);
+        long mPlus = m + i;
+        if (mPlus < max) {
+          // we found a line separator and don't need to consult the next byte.
+          if (lineSeparator[i] == PlatformDependent.getByte(mPlus) && i == lineSeparator.length
- 1) {
+            length = (int) (mPlus - bStart) + 1;
+            endFound = true;
             return;
           }
+        } else {
+          // the last N characters of the read were remnant bytes. We'll hold off on dealing
with these bytes until the next read.
+          remByte = i;
+          length = length - i;
+          return;
         }
-        break;
       }
-      // we found line delimiter
-      length = (int) (mTemp - bStart);
-      endFound = true;
-      break;
     }
   }
 


Mime
View raw message