hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Douglas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-5307) Fix null value handling in StringUtils#arrayToString() and #getStrings()
Date Fri, 13 Mar 2009 00:12:50 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-5307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681555#action_12681555

Chris Douglas commented on HADOOP-5307:

# bq. I believe that *using a pragmatical value for representing nulls, [...], does not introduce
a backward incompatibility at all*.
# bq. As for escaping literal instances of "\_\_null\_\_", *we can introduce an escaping mechanism,
however it will not be backwards compatible*, since "any" form of escaping the value will
result in some literal matching the value which was not set by StringUtils#arrayToStrings().

These read as mutually exclusive statements. If escaping "\_\_null\_\_" is backwards-incompatible,
then escaping {{null}} is, too. That any escape sequence needs a way to represent itself literally
isn't controversial. Further, the change is to a public utility class: even if we defined
"incompatible" statistically, the frequency of either case is unknown since its domain is

I'm a little confused about why StringUtils needs its own escape for a null reference. Converting
an array of String with a null reference to a String with a special symbol for null is odd.
It's cleaner to throw from StringUtils if it gets {{null}} and require callers to handle escaping.

bq. The issue occurs in the context of storing/restoring an array(with possible null values)
in the configuration. The specific use case arose after HADOOP-4955 [...]

HADOOP-4955 probably should not have been committed to 0.19.1. It reads as an improvement,
not a fix to a regression.

That said, if HADOOP-4955 is the cause, then this _is_ a regression in 0.19.1. I'm not sure
what to do about this. Since the regression is in DBOutputFormat, wouldn't it make sense to
fix this there?

* What was committed didn't match the patch posted here. There was a conflict in the imports
for StringUtils.
* One of the cases added in testArrayToStringToArray (nullArr3) doesn't have a corresponding

> Fix null value handling in StringUtils#arrayToString() and #getStrings()
> ------------------------------------------------------------------------
>                 Key: HADOOP-5307
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5307
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.21.0
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: h5307_v1.patch
> StringUtils#arrayToString() converts String array to a String of comma separated elements.
If the String array includes null values, these are recovered as "null" (literal) from getStrings()
method, which eventually causes configuration issues. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message