You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hemanth Yamijala (JIRA)" <ji...@apache.org> on 2009/09/01 16:00:32 UTC

[jira] Created: (HADOOP-6228) Configuration should allow storage of null values.

Configuration should allow storage of null values.
--------------------------------------------------

                 Key: HADOOP-6228
                 URL: https://issues.apache.org/jira/browse/HADOOP-6228
             Project: Hadoop Common
          Issue Type: Bug
          Components: conf
            Reporter: Hemanth Yamijala


Currently the configuration class does not allow null keys and values. Null keys don't make sense, but null values may have semantic meaning for some features. Not storing these values in configuration causes some arguable side effects. For instance, if a value is defined in defaults, but wants to be disabled in site configuration by setting it to null, there's no way to do this currently. Also, no track of keys with null values is recorded. Hence, tools like dump configuration (HADOOP-6184) would not display these properties.

Does this seem like a sensible use case ?

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


[jira] Commented: (HADOOP-6228) Configuration should allow storage of null values.

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750506#action_12750506 ] 

Steve Loughran commented on HADOOP-6228:
----------------------------------------

# Yes, {{<value></value>}}  is effectively the empty string, at least for string values. I guess it gets complex with integers. 
# There's also that trailing whitespace problem, is {{<value>
</value> }} == "" too?
# Nullness is a very strange thing to deal with in text formats; empty strings are simpler. Those things that look for a script could say "script name == empty string => skip". 
# Processing integers is harder. If you do a Conf.getInt(key, 10), and Configuration.get(key) returns "" over null, does that mean you want the default, or null?

Either way, this is quite a big change in the configuration side of things.


> Configuration should allow storage of null values.
> --------------------------------------------------
>
>                 Key: HADOOP-6228
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6228
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Hemanth Yamijala
>
> Currently the configuration class does not allow null keys and values. Null keys don't make sense, but null values may have semantic meaning for some features. Not storing these values in configuration causes some arguable side effects. For instance, if a value is defined in defaults, but wants to be disabled in site configuration by setting it to null, there's no way to do this currently. Also, no track of keys with null values is recorded. Hence, tools like dump configuration (HADOOP-6184) would not display these properties.
> Does this seem like a sensible use case ?

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


[jira] Commented: (HADOOP-6228) Configuration should allow storage of null values.

Posted by "Hemanth Yamijala (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749915#action_12749915 ] 

Hemanth Yamijala commented on HADOOP-6228:
------------------------------------------

One of the implementation issues is that we store the configuration information using Properties, which doesn't allow null values. But this can be changed to a Map datastructure, if the requirement is agreed to. Thoughts ?

> Configuration should allow storage of null values.
> --------------------------------------------------
>
>                 Key: HADOOP-6228
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6228
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Hemanth Yamijala
>
> Currently the configuration class does not allow null keys and values. Null keys don't make sense, but null values may have semantic meaning for some features. Not storing these values in configuration causes some arguable side effects. For instance, if a value is defined in defaults, but wants to be disabled in site configuration by setting it to null, there's no way to do this currently. Also, no track of keys with null values is recorded. Hence, tools like dump configuration (HADOOP-6184) would not display these properties.
> Does this seem like a sensible use case ?

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


[jira] Commented: (HADOOP-6228) Configuration should allow storage of null values.

Posted by "Hemanth Yamijala (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749963#action_12749963 ] 

Hemanth Yamijala commented on HADOOP-6228:
------------------------------------------

bq. Which situations are in there that you can't just get away with an empty string instead?

Steve, this may work as well. But currently if there's no value defined for a property (i.e. we have something like <value></value> in the config file), this is returned as null, and not as empty string. I suppose this can be changed though ? Is that what you are saying we can do ?



> Configuration should allow storage of null values.
> --------------------------------------------------
>
>                 Key: HADOOP-6228
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6228
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Hemanth Yamijala
>
> Currently the configuration class does not allow null keys and values. Null keys don't make sense, but null values may have semantic meaning for some features. Not storing these values in configuration causes some arguable side effects. For instance, if a value is defined in defaults, but wants to be disabled in site configuration by setting it to null, there's no way to do this currently. Also, no track of keys with null values is recorded. Hence, tools like dump configuration (HADOOP-6184) would not display these properties.
> Does this seem like a sensible use case ?

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


[jira] Commented: (HADOOP-6228) Configuration should allow storage of null values.

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749955#action_12749955 ] 

Steve Loughran commented on HADOOP-6228:
----------------------------------------

I'd be reluctant to do this 
# it's hard to send null values over the wire using XML or JSON
# It's harder for other tools to handle.
# It becomes trickier for other data sources to provide configurations if there is null-ness in there too
# It gets really complicated if you ever add cross-referencing of values. Does the NULL value propagate, or does the string "NULL" travel around.
# It gets complex with inheritance. Believe me, I speak from experience here. If I define a null value  and make it final, does it become impossible for anyone ever to define that value?

Which situations are in there that you can't just get away with an empty string instead? 

> Configuration should allow storage of null values.
> --------------------------------------------------
>
>                 Key: HADOOP-6228
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6228
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Hemanth Yamijala
>
> Currently the configuration class does not allow null keys and values. Null keys don't make sense, but null values may have semantic meaning for some features. Not storing these values in configuration causes some arguable side effects. For instance, if a value is defined in defaults, but wants to be disabled in site configuration by setting it to null, there's no way to do this currently. Also, no track of keys with null values is recorded. Hence, tools like dump configuration (HADOOP-6184) would not display these properties.
> Does this seem like a sensible use case ?

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


[jira] Commented: (HADOOP-6228) Configuration should allow storage of null values.

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749982#action_12749982 ] 

Konstantin Boudnik commented on HADOOP-6228:
--------------------------------------------

I tend to agree with Steve. Also, I believe the testing effort for this change might be quite heavy.

> Configuration should allow storage of null values.
> --------------------------------------------------
>
>                 Key: HADOOP-6228
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6228
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Hemanth Yamijala
>
> Currently the configuration class does not allow null keys and values. Null keys don't make sense, but null values may have semantic meaning for some features. Not storing these values in configuration causes some arguable side effects. For instance, if a value is defined in defaults, but wants to be disabled in site configuration by setting it to null, there's no way to do this currently. Also, no track of keys with null values is recorded. Hence, tools like dump configuration (HADOOP-6184) would not display these properties.
> Does this seem like a sensible use case ?

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