Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2983#discussion_r19680835
  
    --- Diff: python/pyspark/sql.py ---
    @@ -439,9 +462,17 @@ def _parse_datatype_json_string(json_string):
         return _parse_datatype_json_value(json.loads(json_string))
     
     
    +_FIXED_DECIMAL = re.compile("decimal\\((\\d+),(\\d+)\\)")
    +
    +
     def _parse_datatype_json_value(json_value):
         if type(json_value) is unicode and json_value in 
_all_primitive_types.keys():
             return _all_primitive_types[json_value]()
    +    elif type(json_value) is unicode and json_value == u'decimal':
    +        return DecimalType()
    +    elif type(json_value) is unicode and _FIXED_DECIMAL.match(json_value):
    +        m = _FIXED_DECIMAL.match(json_value)
    +        return DecimalType(int(m.group(1)), int(m.group(2)))
    --- End diff --
    
    Could you change these into two levels and raise exception if json_value is 
unicode but can not recognize the value?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to