You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "Zouxxyy (via GitHub)" <gi...@apache.org> on 2025/06/06 10:12:25 UTC
[PR] [spark] Extract postCommit for V2 write [paimon]
Zouxxyy opened a new pull request, #5705:
URL: https://github.com/apache/paimon/pull/5705
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
Linked issue: close #xxx
<!-- 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] [spark] Extract postCommit for V2 write [paimon]
Posted by "YannByron (via GitHub)" <gi...@apache.org>.
YannByron commented on code in PR #5705:
URL: https://github.com/apache/paimon/pull/5705#discussion_r2131978875
##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/write/WriteHelper.scala:
##########
@@ -0,0 +1,114 @@
+/*
+ * 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.spark.write
+
+import org.apache.paimon.CoreOptions
+import org.apache.paimon.CoreOptions.TagCreationMode
+import org.apache.paimon.partition.actions.PartitionMarkDoneAction
+import org.apache.paimon.table.FileStoreTable
+import org.apache.paimon.table.sink.CommitMessage
+import org.apache.paimon.tag.TagBatchCreation
+import org.apache.paimon.utils.{InternalRowPartitionComputer, PartitionPathUtils, PartitionStatisticsReporter, TypeUtils}
+
+import org.apache.spark.internal.Logging
+
+import scala.collection.JavaConverters._
+
+trait WriteHelper extends Logging {
+
+ val table: FileStoreTable
+
+ lazy val coreOptions: CoreOptions = table.coreOptions()
+
+ def postCommit(messages: Seq[CommitMessage]): Unit = {
+ if (messages.isEmpty) {
+ return
+ }
+
+ reportToHms(messages)
Review Comment:
why have to do these in paimon-spark, rather than uniformly in paimon-core ?
--
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] [spark] Extract postCommit for V2 write [paimon]
Posted by "YannByron (via GitHub)" <gi...@apache.org>.
YannByron commented on code in PR #5705:
URL: https://github.com/apache/paimon/pull/5705#discussion_r2131978875
##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/write/WriteHelper.scala:
##########
@@ -0,0 +1,114 @@
+/*
+ * 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.spark.write
+
+import org.apache.paimon.CoreOptions
+import org.apache.paimon.CoreOptions.TagCreationMode
+import org.apache.paimon.partition.actions.PartitionMarkDoneAction
+import org.apache.paimon.table.FileStoreTable
+import org.apache.paimon.table.sink.CommitMessage
+import org.apache.paimon.tag.TagBatchCreation
+import org.apache.paimon.utils.{InternalRowPartitionComputer, PartitionPathUtils, PartitionStatisticsReporter, TypeUtils}
+
+import org.apache.spark.internal.Logging
+
+import scala.collection.JavaConverters._
+
+trait WriteHelper extends Logging {
+
+ val table: FileStoreTable
+
+ lazy val coreOptions: CoreOptions = table.coreOptions()
+
+ def postCommit(messages: Seq[CommitMessage]): Unit = {
+ if (messages.isEmpty) {
+ return
+ }
+
+ reportToHms(messages)
Review Comment:
why have to do these in paimon-spark, rather than uniformly in paimon-core ?
--
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] [spark] Extract postCommit for V2 write [paimon]
Posted by "Zouxxyy (via GitHub)" <gi...@apache.org>.
Zouxxyy commented on PR #5705:
URL: https://github.com/apache/paimon/pull/5705#issuecomment-2948921428
> Can you explain what this pr focuses on? @Zouxxyy
Some post-commit operations, such as tagCreation and reportHms, were only applied to the v1 writer. This PR extracts them and makes them effective for both v1 and v2 writers.
--
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] [spark] Extract postCommit for V2 write [paimon]
Posted by "YannByron (via GitHub)" <gi...@apache.org>.
YannByron commented on PR #5705:
URL: https://github.com/apache/paimon/pull/5705#issuecomment-2948885689
Can you explain what this pr focuses on? @Zouxxyy
--
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] [spark] Extract postCommit for V2 write [paimon]
Posted by "YannByron (via GitHub)" <gi...@apache.org>.
YannByron merged PR #5705:
URL: https://github.com/apache/paimon/pull/5705
--
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