Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] Add recoverWithNull to JSONOptions and pass to Table.readJSON #14078

Merged
merged 6 commits into from
Sep 12, 2023

Conversation

andygrove
Copy link
Contributor

Description

This PR exposes the recently added json_reader_options_builder::recovery_mode option in the JNI layer.

closes #14073

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@andygrove andygrove added Java Affects Java cuDF API. Spark Functionality that helps Spark RAPIDS labels Sep 11, 2023
@andygrove andygrove requested a review from a team as a code owner September 11, 2023 21:37
@andygrove andygrove self-assigned this Sep 11, 2023
@copy-pr-bot
Copy link

copy-pr-bot bot commented Sep 11, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Contributor

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@revans2 revans2 added 3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 12, 2023
@ttnghia
Copy link
Contributor

ttnghia commented Sep 12, 2023

/merge

@ttnghia
Copy link
Contributor

ttnghia commented Sep 12, 2023

/ok to test

@ttnghia
Copy link
Contributor

ttnghia commented Sep 12, 2023

Failed style check:

diff --git a/java/src/main/native/src/TableJni.cpp b/java/src/main/native/src/TableJni.cpp
index 0c029a128a..b208ef8f38 100644
--- a/java/src/main/native/src/TableJni.cpp
+++ b/java/src/main/native/src/TableJni.cpp
@@ -1346,7 +1346,8 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Table_readAndInferJSON(
                                         static_cast<std::size_t>(buffer_length)};
 
     auto const recovery_mode = recover_with_null ?
-        cudf::io::json_recovery_mode_t::RECOVER_WITH_NULL : cudf::io::json_recovery_mode_t::FAIL;
+                                   cudf::io::json_recovery_mode_t::RECOVER_WITH_NULL :
+                                   cudf::io::json_recovery_mode_t::FAIL;
     cudf::io::json_reader_options_builder opts = cudf::io::json_reader_options::builder(source)
                                                      .dayfirst(static_cast<bool>(day_first))
                                                      .lines(static_cast<bool>(lines))
@@ -1453,8 +1454,9 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Table_readJSON(
                                                       static_cast<std::size_t>(buffer_length)} :
                                 cudf::io::source_info{filename.get()};
 
-    cudf::io::json_recovery_mode_t recovery_mode = recover_with_null ?
-        cudf::io::json_recovery_mode_t::RECOVER_WITH_NULL : cudf::io::json_recovery_mode_t::FAIL;
+    cudf::io::json_recovery_mode_t recovery_mode =
+        recover_with_null ? cudf::io::json_recovery_mode_t::RECOVER_WITH_NULL :
+                            cudf::io::json_recovery_mode_t::FAIL;
     cudf::io::json_reader_options_builder opts = cudf::io::json_reader_options::builder(source)
                                                      .dayfirst(static_cast<bool>(day_first))
                                                      .lines(static_cast<bool>(lines))

@gerashegalov
Copy link
Contributor

pre-commit run clang-format --all-files

@ttnghia
Copy link
Contributor

ttnghia commented Sep 12, 2023

/ok to test

@rapids-bot rapids-bot bot merged commit 258e0fe into rapidsai:branch-23.10 Sep 12, 2023
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. non-breaking Non-breaking change Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] [JNI] Add recovery_mode option to Java_ai_rapids_cudf_Table_readJSON
5 participants