You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2025/11/22 11:04:10 UTC
[PR] [core] Abstract LookupSerializerFactory and extract classes from LookupLevels [paimon]
JingsongLi opened a new pull request, #6659:
URL: https://github.com/apache/paimon/pull/6659
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
Refactor codes for remote sst files. Abstract `LookupSerializerFactory` and extract classes from LookupLevels to clean LookupLevels.
<!-- What is the purpose of the change -->
### Tests
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Abstract LookupSerializerFactory and extract classes from LookupLevels [paimon]
Posted by "tsreaper (via GitHub)" <gi...@apache.org>.
tsreaper merged PR #6659:
URL: https://github.com/apache/paimon/pull/6659
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Abstract LookupSerializerFactory and extract classes from LookupLevels [paimon]
Posted by "tsreaper (via GitHub)" <gi...@apache.org>.
tsreaper commented on code in PR #6659:
URL: https://github.com/apache/paimon/pull/6659#discussion_r2554642313
##########
paimon-core/src/main/java/org/apache/paimon/mergetree/lookup/PersistPositionProcessor.java:
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ */
+
+package org.apache.paimon.mergetree.lookup;
+
+import org.apache.paimon.KeyValue;
+import org.apache.paimon.data.InternalRow;
+import org.apache.paimon.memory.MemorySegment;
+import org.apache.paimon.types.RowKind;
+import org.apache.paimon.types.RowType;
+
+import javax.annotation.Nullable;
+
+import java.util.Arrays;
+import java.util.function.Function;
+
+import static org.apache.paimon.utils.VarLengthIntUtils.MAX_VAR_LONG_SIZE;
+import static org.apache.paimon.utils.VarLengthIntUtils.decodeLong;
+import static org.apache.paimon.utils.VarLengthIntUtils.encodeLong;
+
+/** A {@link PersistProcessor} to return {@link PositionedKeyValue}. */
+public class PersistPositionProcessor implements PersistProcessor<PositionedKeyValue> {
+
+ private final Function<InternalRow, byte[]> serializer;
+ private final Function<byte[], InternalRow> deserializer;
+ private final boolean persistValue;
+
+ public PersistPositionProcessor(
+ Function<InternalRow, byte[]> serializer,
+ Function<byte[], InternalRow> deserializer,
+ boolean persistValue) {
+ this.serializer = serializer;
+ this.deserializer = deserializer;
+ this.persistValue = persistValue;
+ }
+
+ @Override
+ public boolean withPosition() {
+ return true;
+ }
+
+ @Override
+ public byte[] persistToDisk(KeyValue kv) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public byte[] persistToDisk(KeyValue kv, long rowPosition) {
+ if (persistValue) {
Review Comment:
Both `persistToDisk` and `readFromDisk` need to check `persistValue`. It seems that this class actually combines two `PersistProcessor`. Split them into two classes.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org