[ 
https://issues.apache.org/jira/browse/SOLR-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671478#action_12671478
 ] 

Jared Flatow commented on SOLR-993:
-----------------------------------

bq. This patch is WRONG. It would not work for the functions namespace. Because 
functions implements a custom map. look at EvaluatorBag.getFunctionsNameSpace().

Why shouldn't it work for the EvaluatorBag Functions? I am using the patch, as 
well as those functions...

bq. Moreover ,your version of the VariableResolverImpl is more expensive and 
creates more objects. Map.putAll() is far more expensive because it creates so 
many Map.Entry and removals are more costly.

Given the size of the namespaces I doubt there is a major performance penalty 
(it only creates "so many Map.Entry"s if they exist in the namespace already), 
but if that is a concern it can be avoided by getting the parent namespace 
first.

bq. Can you tell me what are you trying to achieve. If you can give me usecases 
It may help me solve it better.

I want to define the behavior of the VariableResolver better so it is more 
usable. There are significant ambiguities with the existing implementation. The 
"DOT_SPLIT and backup" of namespace names is incorrect. What if I have a 
namespace "a.b" containing a mapping with key "c.d", what does "a.b.c.d" refer 
to? The answer currently is it depends what other namespaces I have. 

Ideally, I would like to see the VariableResolver interface define the correct 
way to put values in/out of a namespace, and tell you which values are going to 
be overwritten when. This will make writing transformers more straightforward.

> VariableResolverImpl addNamespace overwrites entire namespace instead of 
> adding
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-993
>                 URL: https://issues.apache.org/jira/browse/SOLR-993
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.4
>            Reporter: Jared Flatow
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-993.patch, SOLR-993b.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> The addNamespace method in VariableResolverImpl does not so much add the 
> namespace as overwrite it. 

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

Reply via email to