dolthub / dolt

Dolt – Git for Data
Apache License 2.0
17.81k stars 505 forks source link

Fixed keyless secondary indexing for Doltgres #8081

Closed Hydrocharged closed 3 months ago

Hydrocharged commented 3 months ago

This PR fixes two issues with creating secondary indexes for Doltgres types. The first deals with handlers, as we were not adding a nil handler for the additional hash type, which would cause a panic as the counts were not equal (all non-Extended types should have a matching nil handler).

The second issue was due to the reuse of an ExtendedTupleComparator. When creating a new ExtendedTupleComparator, we pass in the previous TupleTypeHandler to handle all non-Extended types. If the previous TupleTypeHandler was ExtendedTupleComparator and the new one was also ExtendedTupleComparator, then we could end up with a misinterpretation of data that could lead to incorrect results, as the handler assumed a different type than the actual type. This has been changed so that ExtendedTupleComparator will always use the inner comparator of a previous ExtendedTupleComparator. For now this will always be the default comparator, but if we ever add another one, then this should properly handle that change.

coffeegoddd commented 3 months ago

@Hydrocharged DOLT

comparing_percentages
100.000000 to 100.000000
version result total
e14c64b ok 5937457
version total_tests
e14c64b 5937457
correctness_percentage
100.0