Fix signed and whitespace-padded NaN parsing #5568
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 297 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.341
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5568"
general
weight: 0.35
wjxiz1992
Fixes #5535. Contributes to NVIDIA/cudf-spark#17074.
String-to-FLOAT/DOUBLE casts now accept
+NaNand-NaN, matching Spark. Previously these valid inputs produced NULL with ANSI disabled and an input-format error with ANSI enabled. Signed noncanonical spellings such as+nAnremain invalid, while unsigned NaN remains case-insensitive.The parser checks the exact spelling before consuming the token, handles NaN/sign splits across 32-byte parser windows, and checks whole-row consumption after trailing whitespace. Unsigned NaN with long surrounding whitespace also follows Spark's behavior. Numeric-parser state is preserved when the token is not NaN.
The new regression tests cover both output types and ANSI modes, all NaN case variants, surrounding whitespace/C0 controls, null propagation, repeated signs, invalid suffixes and trailing garbage. They include 981 valid-input rows and 270 invalid-input rows, with padding around the 32/64-byte boundaries.
Validation:
+NaN; the invalid-input control passes.mvn package: passed; completeCastStringsTest: 82 passed, 0 failed, 0 skipped.GpuProjectoverGpuRange; class-source checks verify the newly built JNI is loaded.730ebf0bwith its embedded JNI replaced by this build, matching its cuDF/JNI 27.02 dependency. All retained plugin entries were verified unchanged.The additional spelling check runs only after recognizing NaN, and the extra warp vote is needed only for signed tokens. The boundary probe reads three bytes only when a token can straddle a parser window. There are no additional column passes or allocations. Performance was not benchmarked.
AI assistance was used for investigation, implementation, review and validation.