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

JSON reader validation of values #15968

Merged

Conversation

karthikeyann
Copy link
Contributor

@karthikeyann karthikeyann commented Jun 11, 2024

Description

Addresses part of #15222
This change adds validation stage in JSON reader at tokens level. If any validation fails in a row, it will make the entire row as null.

Checklist

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

@karthikeyann karthikeyann added feature request New feature or request 2 - In Progress Currently a work in progress cuIO cuIO issue Spark Functionality that helps Spark RAPIDS labels Jun 11, 2024
@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Jun 11, 2024
@karthikeyann karthikeyann changed the title JSON validation of Values JSON reader validation of values Jun 11, 2024
@karthikeyann karthikeyann added the non-breaking Non-breaking change label Jun 13, 2024
@github-actions github-actions bot added the Java Affects Java cuDF API. label Aug 2, 2024
@karthikeyann karthikeyann changed the base branch from branch-24.08 to branch-24.10 August 2, 2024 21:14
@karthikeyann karthikeyann marked this pull request as ready for review August 9, 2024 20:32
@karthikeyann karthikeyann requested review from a team as code owners August 9, 2024 20:32
@karthikeyann karthikeyann marked this pull request as draft August 9, 2024 20:32
karthikeyann and others added 3 commits September 9, 2024 22:05
Co-authored-by: Nghia Truong <7416935+ttnghia@users.noreply.github.com>
Co-authored-by: Nghia Truong <7416935+ttnghia@users.noreply.github.com>
cpp/include/cudf/io/json.hpp Outdated Show resolved Hide resolved
cpp/include/cudf/io/json.hpp Outdated Show resolved Hide resolved
cpp/include/cudf/io/json.hpp Outdated Show resolved Hide resolved
@@ -1683,6 +1696,10 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Table_readAndInferJSON(JNIEnv* env,
.recovery_mode(recovery_mode)
.normalize_single_quotes(static_cast<bool>(normalize_single_quotes))
.normalize_whitespace(static_cast<bool>(normalize_whitespace))
.strict_validation(strict_validation)
Copy link
Contributor

Choose a reason for hiding this comment

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

This code has to change now for the tests to pass. We have to not try and set

        .numeric_leading_zeros(allow_leading_zeros)
        .nonnumeric_numbers(allow_nonnumeric_numbers)
        .unquoted_control_chars(allow_unquoted_control)

at all if strict_validation is disabled. And this goes for all of the APIs in this file because of the assertion that was just added in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

java/src/main/native/src/TableJni.cpp Outdated Show resolved Hide resolved
java/src/main/native/src/TableJni.cpp Outdated Show resolved Hide resolved
java/src/main/native/src/TableJni.cpp Outdated Show resolved Hide resolved
java/src/main/native/src/TableJni.cpp Outdated Show resolved Hide resolved
@karthikeyann
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 9acbaf8 into rapidsai:branch-24.10 Sep 11, 2024
98 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 CMake CMake build issue cuIO cuIO issue feature request New feature or request Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Spark Functionality that helps Spark RAPIDS
Projects
Status: Done
Status: Landed
Development

Successfully merging this pull request may close these issues.

6 participants