You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/02/25 03:56:24 UTC

[GitHub] [incubator-iceberg] shawnding commented on a change in pull request #723: Arrow changes for supporting vectorized reads

shawnding commented on a change in pull request #723: Arrow changes for supporting vectorized reads
URL: https://github.com/apache/incubator-iceberg/pull/723#discussion_r383646541
 
 

 ##########
 File path: parquet/src/main/java/org/apache/iceberg/parquet/ValuesAsBytesReader.java
 ##########
 @@ -76,12 +91,29 @@ public final boolean readBoolean() {
     return value;
   }
 
+  /**
+   *
+   * @return 1 if true, 0 otherwise
+   */
+  public final int readBooleanAsInt() {
+    if (bitOffset == 0) {
+      currentByte = getByte();
+    }
+    int value = (currentByte & (1 << bitOffset)) >> bitOffset;
+    bitOffset += 1;
+    if (bitOffset == 8) {
+      bitOffset = 0;
+    }
+    return value;
+  }
+
   private byte getByte() {
     try {
       return (byte) valuesInputStream.read();
     } catch (IOException e) {
       throw new ParquetDecodingException("Failed to read a byte", e);
     }
   }
+
 
 Review comment:
   maybe unnecessary empty line.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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