Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private static Block createInternal(int positionCount, Block dictionary, int[] i
newIds[position] = dictionaryBlock.getId(ids[position]);
}
dictionary = dictionaryBlock.getDictionary();
dictionarySourceId = dictionaryBlock.getDictionarySourceId();
Copy link
Copy Markdown
Member

@sopel39 sopel39 Sep 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's still wrong. Consider two blocks with nested dictionaries:

topN:
  sourceId: A
  ids: [0, 2, 2]
    nestedY:
      source: 1
      ids: [1, 2, 3]
      block: X
topM:
   sourceId: B
   ids: [0, 1]
   nestedV:
      source: 1
      ids: [1, 2, 3]
      block: Y

You cannot make them

topM':
   sourceId: 1
   ids: [1, 3, 3]
   block: X

topN':
   sourceId: 1
   ids: [1, 2]
   block: Y

topM', topN' cannot have same source ids as topM'.ids != topN'.ids. Even if ids were same, they might have originated from different source and just coincidentally be same

ids = newIds;
}
return new DictionaryBlock(0, positionCount, dictionary, ids, false, false, dictionarySourceId);
Expand Down