From 3777dfc72b9f3cdcdc7451d61770f0376feb5cc2 Mon Sep 17 00:00:00 2001 From: Zac Wen Date: Mon, 22 Jan 2024 09:01:41 -0800 Subject: [PATCH] Enhance empty file handling (#8459) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/8459 Enhance empty file handling especially for empty files with headers by checking if the reader actually reads nothing. 1. The current implementation checks if `pos_` is `0` which does not cover the case when a header is present in the file. 2. When `skipLine()` returns true the loop should not be broken as logic like elements counting and null setting still yet to happen. Reviewed By: Yuhta Differential Revision: D52929853 fbshipit-source-id: 7e1c52c8cdf09b04f453d7ad81235429796096c9 --- velox/dwio/common/Options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/velox/dwio/common/Options.h b/velox/dwio/common/Options.h index 5f2a688765f8..ecebe4c62848 100644 --- a/velox/dwio/common/Options.h +++ b/velox/dwio/common/Options.h @@ -361,7 +361,7 @@ class RowReaderOptions { skipRows_ = skipRows; } - bool getSkipRows() const { + uint64_t getSkipRows() const { return skipRows_; }