lszskye commented on code in PR #461:
URL: https://github.com/apache/paimon-cpp/pull/461#discussion_r4409794350


##########
src/paimon/core/table/source/data_evolution_full_text_scan.cpp:
##########
@@ -0,0 +1,328 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "paimon/core/table/source/data_evolution_full_text_scan.h"
+
+#include <algorithm>
+#include <cassert>
+#include <functional>
+#include <iterator>
+#include <limits>
+#include <map>
+#include <optional>
+#include <set>
+#include <string>
+#include <tuple>
+#include <unordered_map>
+#include <utility>
+
+#include "fmt/format.h"
+#include "fmt/ranges.h"
+#include "paimon/core/index/index_file_handler.h"
+#include "paimon/core/manifest/index_manifest_entry.h"
+#include "paimon/core/manifest/index_manifest_file.h"
+#include "paimon/core/snapshot.h"
+#include "paimon/core/table/source/index_full_text_search_split_impl.h"
+#include "paimon/core/tag/tag.h"
+#include "paimon/core/utils/branch_manager.h"
+#include "paimon/core/utils/index_file_path_factories.h"
+#include "paimon/core/utils/snapshot_manager.h"
+#include "paimon/core/utils/tag_manager.h"
+#include "paimon/defs.h"
+#include "paimon/global_index/full_text/full_text_defs.h"
+#include "paimon/global_index/global_indexer.h"
+#include "paimon/global_index/global_indexer_factory.h"
+#include "paimon/global_index/lucene/lucene_defs.h"
+
+namespace paimon {
+namespace {
+/// The files of one index shard that may rank rows of the searched field.
+struct IndexRangeCandidate {
+    Range file_range;
+    std::string identity;
+    /// Whether the searched field is the indexed field of the index, not an 
extra field.
+    bool primary;
+    std::vector<std::shared_ptr<IndexFileMeta>> files;
+    /// The rows assigned to this shard, merged as they are assigned in 
ascending order.
+    std::vector<Range> assigned;
+};
+
+/// Resolves the snapshot to search as Java `TimeTravelUtil#tryTravelOrLatest` 
does: the one that
+/// the time-travel option selects, whatever `scan.mode` is, or else the 
latest one.

Review Comment:
   Could we add a TODO here clarifying that Paimon C++ currently selects the 
requested historical snapshot but still uses the latest table schema, rather 
than the schema associated with that snapshot? This means the behavior is not 
fully equivalent to Java’s time-travel flow.



-- 
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]

Reply via email to