Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4ADFF17F76 for ; Wed, 22 Oct 2014 07:29:40 +0000 (UTC) Received: (qmail 49021 invoked by uid 500); 22 Oct 2014 07:29:34 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 48972 invoked by uid 500); 22 Oct 2014 07:29:34 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 48961 invoked by uid 99); 22 Oct 2014 07:29:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Oct 2014 07:29:34 +0000 Date: Wed, 22 Oct 2014 07:29:34 +0000 (UTC) From: "Wangda Tan (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-11199) Configuration should be able to set empty value for property MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-11199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14179682#comment-14179682 ] Wangda Tan commented on HADOOP-11199: ------------------------------------- [~rchiang], thanks for you patch, Actually, I don't think this is intentional, because we cannot set an empty value instead of null for a key in configuration. And the empty value configuration should be a determinate behavior instead of a configurable one, there's complete different semantics between empty and null. I think if a existing module rely on behavior today should be updated. Do you have any example for configs rely on this? Thanks, Wangda > Configuration should be able to set empty value for property > ------------------------------------------------------------ > > Key: HADOOP-11199 > URL: https://issues.apache.org/jira/browse/HADOOP-11199 > Project: Hadoop Common > Issue Type: Bug > Components: conf > Reporter: Wangda Tan > Attachments: HADOOP-11199-01.patch > > > Currently in hadoop.common.conf.Configuration, when you specify a XML like this: > {code} > > > conf.name > > > > {code} > When you trying to get the conf.name, the returned value is null instead of an empty string. > Test code for this, > {code} > import java.io.ByteArrayInputStream; > import org.apache.hadoop.conf.Configuration; > public class HadoopConfigurationEmptyTest { > public static void main(String[] args) { > Configuration conf = new Configuration(false); > ByteArrayInputStream bais = > new ByteArrayInputStream(("" > + "conf.name" + "" > + "").getBytes()); > conf.addResource(bais); > System.out.println(conf.get("conf.name")); > } > } > {code} > Does this intentionally or a behavior should be fixed? -- This message was sent by Atlassian JIRA (v6.3.4#6332)