Skip to content

Commit

Permalink
Fix start character
Browse files Browse the repository at this point in the history
Signed-off-by: Nghia Truong <[email protected]>
  • Loading branch information
ttnghia committed Sep 30, 2024
1 parent 91769c7 commit 45a929f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/cpp/src/json_utils.cu
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ std::tuple<std::unique_ptr<cudf::column>, std::unique_ptr<rmm::device_buffer>, c
if (is_null_literal) { return {false, true}; }

auto const not_eol = i < d_str.size_bytes();

// If the first row is not null or empty, it should start with `{`.
// Otherwise, we need to replace it by a null.
// This is necessary for libcudf's JSON reader to work.
// Note that if we want to support ARRAY schema, we need to check for either `{` or `[`.
auto constexpr start_character = '{';
if (not_eol && d_str[i] != start_character) { return {false, true}; }

return {not_eol, not_eol};
});

Expand Down

0 comments on commit 45a929f

Please sign in to comment.