carloea2 commented on code in PR #8341:
URL: https://github.com/apache/texera/pull/8341#discussion_r4267309786


##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/StandaloneHelpers.scala:
##########
@@ -144,6 +144,38 @@ object StandaloneHelpers {
       |    return float(x)
       |
       |
+      |def _texera_java_double(text):
+      |    # Double.parseDouble on the trimmed text, which a read field reaches
+      |    # through `toDouble`. It takes a trailing d or f as a type suffix 
and
+      |    # 0x...p... as a hex literal, both of which float() refuses.
+      |    text = text.strip()
+      |    if text[-1:] in ("d", "D", "f", "F"):
+      |        text = text[:-1]
+      |    if text.lstrip("+-")[:2].lower() == "0x":
+      |        return float.fromhex(text)

Review Comment:
   A CSV containing `0x1p1024` or `-0x1p1024` is inferred as DOUBLE and 
produces positive or negative infinity in each native reader. The generated 
export instead raises OverflowError here. Reproduced with CSV, CSV Old and 
Parallel CSV; `0x1p3` and the maximum finite hex double both pass. Please match 
Java's overflow behavior and add these cases to the parity tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to