Skip to content

Unit test for IndexerFactory: IndexerFactoryTest #1989

@ge0ffrey

Description

@ge0ffrey

I think it would be good to test the IndexFactory in isolation by calling buildUniKeysExtractor().

Specifically, this piece of code looks wierd to me.

            for (var i = 1; i <= joinerCount; i++) {
                var joinerType = i < joinerCount ? joiner.getJoinerType(i) : null;
                var previousJoinerType = joiner.getJoinerType(i - 1);
                if (joinerType != JoinerType.EQUAL || previousJoinerType != joinerType) {
                    /*
                     * Equal joiner is building a composite key with preceding equal joiner(s).
                     * Does not apply to joiners other than equal; for those, each indexer has its own simple key.
                     */
                    joinerTypeMap.put(i, previousJoinerType);
                }
            }

What does it do given (equals, equals, equals, lessThan, equals, equals)?
If the equals are merged, why would it have 5 entries in the map instead of 2? // not true, it it only has 3 entries, which makes sense.
Why are keys in the map not zero based (see put(i, previousJoinerType))?

Metadata

Metadata

Assignees

No one assigned

    Labels

    process/needs triageRequires initial assessment of validity, priority etc.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions