ekmett / tables

Deprecated because of
https://github.com/ekmett/tables/issues/15
Other
78 stars 13 forks source link

InvertedMap indices empty for multirow Table #6

Open dag opened 11 years ago

dag commented 11 years ago
>>> :set +t
>>> fetch AffixK (state^?!wordData.ix "donri")
fromList ["do'i","dor"]
it :: Data.Set.Set Affix
>>> state^.wordData.withAll AffixK ["dor"]
fromList []
it :: Table WordData
>>> state^.wordData.withAny AffixK ["dor"]
fromList []
it :: Table WordData
dag commented 11 years ago

If @Taneb could take a looksie that'd be great!

dag commented 11 years ago

The t -> [a] instance seems to work though:

>>> state^..wordData.withAny (toListOf folded . fetch AffixK) ["dor"].folded.word'
["donri"]
dag commented 11 years ago

Although I'm not sure about withAll for that instance:

>>> state^.wordData.withAll (toListOf folded . fetch AffixK) ["dor"] & count
5911

Shoudn't withAll and withAny be equivalent when given a singleton list?

ekmett commented 11 years ago

They should be, yes.

dag commented 11 years ago

It looks like the inverted indices are correctly set up for singleton tables, but they're empty for tables with more than one row. It also seems that withAny and withAll work correctly for singleton tables. This suggests to me that the problem likely is in either unsafeInsert or deleteCollisions (or both).

ghost commented 7 years ago

I'd like to investigate this issue but there is not enough context given in the report to reproduce the result myself. I know it's been quite a while since this issue was opened but if the reporter still has the code that produced this issue would they mind posting a more complete test case?