You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "Aitozi (via GitHub)" <gi...@apache.org> on 2024/10/28 05:36:55 UTC
[PR] [flink] PartitionMarkDone enables the use of various partition trigge… [paimon]
Aitozi opened a new pull request, #4386:
URL: https://github.com/apache/paimon/pull/4386
…r strategies.
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
Linked issue: close #xxx
In our company, we have encountered an issue with the HMS partition statistic being incorrect. This is because during the writing process, we only update the metastore partition when it is first written to.
Therefore, we would like to implement the PartitionMarkDone strategy to update the statistics in HMS after a short idle period for each partition.
We need a separate configuration for PartitionMarkDone due to differing requirements:
- We do not want to rely on extracting accurate timestamps from partition names.
- We aim to store each partition's last access time in state so that it can be reported back to HMS.
To achieve this, we plan on extending `PartitionMarkDone` functionality to support different trigger strategies for partitions. Following this extension, we will be able to introduce custom triggers such as `PartitionHmsReporterTrigger`.
<!-- 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] [flink] PartitionMarkDone enables the use of various partition trigge… [paimon]
Posted by "Aitozi (via GitHub)" <gi...@apache.org>.
Aitozi commented on code in PR #4386:
URL: https://github.com/apache/paimon/pull/4386#discussion_r1820235483
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/PartitionMarkDoneTrigger.java:
##########
@@ -65,21 +78,30 @@ public class PartitionMarkDoneTrigger {
@Nullable private final Long idleTime;
private final boolean markDoneWhenEndInput;
private final Map<String, Long> pendingPartitions;
+ private final List<PartitionMarkDoneAction> actions;
+ private final boolean waitCompaction;
+ private final InternalRowPartitionComputer partitionComputer;
public PartitionMarkDoneTrigger(
State state,
PartitionTimeExtractor timeExtractor,
@Nullable Duration timeInterval,
@Nullable Duration idleTime,
- boolean markDoneWhenEndInput)
+ boolean markDoneWhenEndInput,
Review Comment:
I reset the commit, and updated in https://github.com/apache/paimon/pull/4398
--
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] [flink] PartitionMarkDone enables the use of various partition trigge… [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #4386:
URL: https://github.com/apache/paimon/pull/4386#issuecomment-2443112908
Hi @Aitozi , can you explain this pr from API level? Or you are modifying current behavior?
--
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] [flink] PartitionMarkDone enables the use of various partition trigge… [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #4386:
URL: https://github.com/apache/paimon/pull/4386#discussion_r1820183945
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/PartitionTrigger.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.flink.sink.partition;
+
+import org.apache.paimon.manifest.ManifestCommittable;
+
+import java.io.Closeable;
+import java.util.List;
+
+/** The partition trigger. */
+public interface PartitionTrigger extends Closeable {
Review Comment:
`PartitionListener`?
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/PartitionCollector.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.flink.sink.partition;
+
+import org.apache.paimon.manifest.ManifestCommittable;
+import org.apache.paimon.table.FileStoreTable;
+import org.apache.paimon.utils.IOUtils;
+
+import org.apache.flink.api.common.state.OperatorStateStore;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/** Partition collector. */
+public class PartitionCollector implements Closeable {
Review Comment:
`PartitionListeners`?
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/PartitionMarkDoneTrigger.java:
##########
@@ -65,21 +78,30 @@ public class PartitionMarkDoneTrigger {
@Nullable private final Long idleTime;
private final boolean markDoneWhenEndInput;
private final Map<String, Long> pendingPartitions;
+ private final List<PartitionMarkDoneAction> actions;
+ private final boolean waitCompaction;
+ private final InternalRowPartitionComputer partitionComputer;
public PartitionMarkDoneTrigger(
State state,
PartitionTimeExtractor timeExtractor,
@Nullable Duration timeInterval,
@Nullable Duration idleTime,
- boolean markDoneWhenEndInput)
+ boolean markDoneWhenEndInput,
Review Comment:
Can you keep `PartitionMarkDone` as it is?
--
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] [flink] PartitionMarkDone enables the use of various partition trigge… [paimon]
Posted by "Aitozi (via GitHub)" <gi...@apache.org>.
Aitozi commented on PR #4386:
URL: https://github.com/apache/paimon/pull/4386#issuecomment-2440596968
WDYT? @JingsongLi
--
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] [flink] PartitionMarkDone enables the use of various partition trigge… [paimon]
Posted by "Aitozi (via GitHub)" <gi...@apache.org>.
Aitozi commented on PR #4386:
URL: https://github.com/apache/paimon/pull/4386#issuecomment-2443142311
@JingsongLi The behavior is not change. In this PR, I extract the `PartitionTrigger` interface, The default is `PartitionMarkDoneTrigger`.
In `StoreCommitter`, it acts the `PartitionCollector`, it can trigger based on different config such as `partition-mark-done` or `hms-report`
--
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] [flink] PartitionMarkDone enables the use of various partition trigge… [paimon]
Posted by "Aitozi (via GitHub)" <gi...@apache.org>.
Aitozi closed pull request #4386: [flink] PartitionMarkDone enables the use of various partition trigge…
URL: https://github.com/apache/paimon/pull/4386
--
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