xiangfu0 commented on code in PR #19894:
URL: https://github.com/apache/pinot/pull/19894#discussion_r4610080041
##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/invertedindex/HnswIndexRollbackTest.java:
##########
@@ -265,6 +267,9 @@ private static File buildSegment(File tempDir, TableConfig
tableConfig, SegmentV
private static void installNewerIndex(File tempDir, File segmentDir,
SegmentVersion version, String layout)
throws Exception {
+ if (Version.LATEST.major != 9) {
+ throw new SkipException("Lucene 10 fixture exercises rollback recovery
on Lucene 9 only");
+ }
Review Comment:
Added fixed Lucene 9.12 fixtures. Tests load and query HNSW in directory and
packed layouts and multi-column text in the directory layout used by both v1
and v3 segments. They verify that preprocessing can reuse the legacy indexes.
The real Lucene 8 fixture now exercises both reader constructors. All six cases
passed on 10.6.0.
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/vector/lucene99/HnswCodec.java:
##########
@@ -69,10 +69,11 @@ public KnnVectorsFormat getKnnVectorsFormatForField(String
field) {
/// Instantiates a new codec, specifying the stored fields compression mode
to use.
///
/// @param mode stored fields compression mode to use for newly
flushed/merged segments.
- public HnswCodec(Lucene912Codec.Mode mode, KnnVectorsFormat
defaultKnnVectorsFormat) {
- super("Lucene99", new Lucene912Codec(mode));
+ public HnswCodec(Lucene100Codec.Mode mode, KnnVectorsFormat
defaultKnnVectorsFormat) {
+ // New indexes use Lucene100 format. Legacy indexes retain Lucene99 and
are read by lucene-backward-codecs.
+ super("Lucene100", new Lucene100Codec(mode));
_defaultKnnVectorsFormat = defaultKnnVectorsFormat;
- _defaultPostingsFormat = new Lucene90PostingsFormat();
+ _defaultPostingsFormat = new Lucene912PostingsFormat();
_defaultDVFormat = new Lucene90DocValuesFormat();
Review Comment:
Addressed in 81585e4235. `HnswCodec` keeps the per-field HNSW vector
override and delegates postings, doc values, and points to `Lucene104Codec`.
The codec persists the delegate’s registered name so Lucene can reopen the
index.
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/fst/RegexpMatcherCaseInsensitive.java:
##########
@@ -44,10 +45,13 @@ public class RegexpMatcherCaseInsensitive {
private final FST<BytesRef> _ifst;
private final Automaton _automaton;
+ @SuppressWarnings("deprecation") // Preserve the complement syntax supported
by existing FST queries.
public RegexpMatcherCaseInsensitive(String regexQuery, FST<BytesRef> ifst) {
_ifst = ifst;
// For case-insensitive FSTs, convert regex to lowercase since we only
store lowercase keys
- _automaton = (new RegExp(regexQuery.toLowerCase())).toAutomaton();
+ _automaton = Operations.determinize(
+ new RegExp(regexQuery.toLowerCase(), RegExp.ALL |
RegExp.DEPRECATED_COMPLEMENT).toAutomaton(),
+ Operations.DEFAULT_DETERMINIZE_WORK_LIMIT);
Review Comment:
Both FST matchers now call `LuceneRegexpAutomaton.compile` for complement
syntax, the construction budget, and determinization. The case-insensitive
matcher passes the expression to it after normalizing case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]