lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Dyer (Updated) (JIRA)" <>
Subject [jira] [Updated] (SOLR-2933) DIHCacheSupport ignores left side of where="" attribute
Date Fri, 02 Dec 2011 17:09:40 GMT


James Dyer updated SOLR-2933:

    Attachment: SOLR-2933.patch


I appreciate your being persistent with this one.  I apologize for not understanding what
you were getting at the first couple times you tried to explain, but I think I finally have
a fix.  See SOLR-2933.patch, attached.

The problem was caused by my not copying code properly from EntityProcessorBase to DIHCacheSupport.
 This broke support for the "where" parameter for cached entity processors.  ("cachePk" &
"cacheLookup" still work and can be used instead of "where" as a workaround).

Further, a shortcoming in TestCachedSqlEntityProcessor masked the problem.  Although the primary
key was not being picked up from the "where" property, the primary key was the first property
being passed in. DIH then assumed (correctly in this case) the first column must be the primary
key.  So the test (#withKeyAndLookup) would pass even though by accident.

This patch:
1. Fixes the bug in DIHCacheSupport.
2. Modifies TestCachedSqlEntityProcessor to reverse the order of one of the incoming documents
so that the primary key is not first.
3. Changes AbstractDataImportHandlerTestCas#createMap to use a LinkedHashMap so that the tested
order will be preserved.  The HashMap that was used prior would always put the primary key
column before the others, even if the test specifies a different order, further masking the

Mikhail, thank you for both pointing out my error and also the prior problems with the test.
> DIHCacheSupport ignores left side of where="" attribute
> ---------------------------------------------------------------
>                 Key: SOLR-2933
>                 URL:
>             Project: Solr
>          Issue Type: Sub-task
>          Components: contrib - DataImportHandler
>    Affects Versions: 4.0
>            Reporter: Mikhail Khludnev
>            Priority: Minor
>              Labels: noob, random
>         Attachments:,
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> DIHCacheSupport introduced at SOLR-2382 uses new config attributes cachePk and cacheLookup.
But support old one where="" is broken by [DIHCacheSupport.<init>|]
- it never put where="" sides into the context, but it revealed by [SortedMapBackedCache.<init>|],
which takes just first column as a primary key. That's why all tests are green.
> To reproduce the issue I need just reorder entry at [line 219|]
and make desc first and picked up as a primary key. 
> To do that I propose to chose concrete map class randomly for all DIH test cases at [createMap()|].

> I'm attaching test breaking patch and seed.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message