Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 32E67200CC2 for ; Wed, 5 Jul 2017 20:56:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 31B0C164237; Wed, 5 Jul 2017 18:56:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9E4E7164236 for ; Wed, 5 Jul 2017 20:56:35 +0200 (CEST) Received: (qmail 58069 invoked by uid 500); 5 Jul 2017 18:56:34 -0000 Mailing-List: contact dev-help@orc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@orc.apache.org Delivered-To: mailing list dev@orc.apache.org Received: (qmail 58058 invoked by uid 99); 5 Jul 2017 18:56:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2017 18:56:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7AC02DFA84; Wed, 5 Jul 2017 18:56:34 +0000 (UTC) From: xndai To: dev@orc.apache.org Reply-To: dev@orc.apache.org References: In-Reply-To: Subject: [GitHub] orc pull request #134: Orc 17 Content-Type: text/plain Message-Id: <20170705185634.7AC02DFA84@git1-us-west.apache.org> Date: Wed, 5 Jul 2017 18:56:34 +0000 (UTC) archived-at: Wed, 05 Jul 2017 18:56:36 -0000 Github user xndai commented on a diff in the pull request: https://github.com/apache/orc/pull/134#discussion_r125728966 --- Diff: c++/src/OrcHdfsFile.cc --- @@ -123,17 +123,21 @@ namespace orc { uint64_t length, uint64_t offset) override { - size_t last_bytes_read = 0; - if (!buf) { throw ParseError("Buffer is null"); } hdfs::Status status; - status = file->PositionRead(buf, static_cast(length), static_cast(offset), &last_bytes_read); - if(!status.ok()) { - throw ParseError("Error reading the file: " + status.ToString()); - } + size_t total_bytes_read = 0; + size_t last_bytes_read = 0; + + do { + status = file->PositionRead(buf, static_cast(length) - total_bytes_read, static_cast(offset + total_bytes_read), &last_bytes_read); --- End diff -- Make sure to wrap on 80 characters. --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---