js8544 commented on code in PR #14242:
URL: https://github.com/apache/arrow/pull/14242#discussion_r981265030


##########
cpp/src/arrow/json/options.h:
##########
@@ -53,6 +53,9 @@ struct ARROW_EXPORT ParseOptions {
   /// How JSON fields outside of explicit_schema (if given) are treated
   UnexpectedFieldBehavior unexpected_field_behavior = 
UnexpectedFieldBehavior::InferType;
 
+  /// Whether decimals are represented as strings(quoted) or numbers(unquoted)
+  bool parse_decimal_as_number = false;

Review Comment:
   Well, we sort of can. The parser defines two types String(to handle quoted 
values) and Number(to handle unquoted values). Each arrow type must belong to 
one of the two types.
   The interesting thing is, the parser actually handles the two types in the 
same way: store the value as strings and convert the string to arrow types 
later. The only difference is type checking, e.g. Decimals can only be String, 
integers can only be Number etc.
   So, we can just remove type checking and delegate parse errors to the arrow 
types themselves. With this approach, there's no constraints on quotes 
whatsoever. "123" can be ints and 123 can be strings.
   Do we want this approach instead?



-- 
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