You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "YannByron (via GitHub)" <gi...@apache.org> on 2023/07/11 14:01:28 UTC

[GitHub] [incubator-paimon] YannByron opened a new pull request, #1541: [spark] Supports paimon_incremental_query Table Valued Function

YannByron opened a new pull request, #1541:
URL: https://github.com/apache/incubator-paimon/pull/1541

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   - Builds Paimon SparkSession Extensions Arch;
   - Supports paimon_incremental_query TVF to query the incr data between the two versions provided.
   
   <!-- 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


[GitHub] [incubator-paimon] YannByron commented on a diff in pull request #1541: [spark] Supports paimon_incremental_query Table Valued Function

Posted by "YannByron (via GitHub)" <gi...@apache.org>.
YannByron commented on code in PR #1541:
URL: https://github.com/apache/incubator-paimon/pull/1541#discussion_r1260713435


##########
docs/content/how-to/querying-tables.md:
##########
@@ -129,7 +129,20 @@ SELECT * FROM t /*+ OPTIONS('incremental-between' = '12,20') */;
 ```
 {{< /tab >}}
 
-{{< tab "Spark" >}}
+{{< tab "Spark3" >}}
+
+Requires Spark 3.2+.
+
+you can use `paimon_incremental_query` in query to extract the incremental data:

Review Comment:
   yep, I miss some configs that's needed.



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


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1541: [spark] Supports paimon_incremental_query Table Valued Function

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1541:
URL: https://github.com/apache/incubator-paimon/pull/1541#discussion_r1260703350


##########
docs/content/how-to/querying-tables.md:
##########
@@ -129,7 +129,20 @@ SELECT * FROM t /*+ OPTIONS('incremental-between' = '12,20') */;
 ```
 {{< /tab >}}
 
-{{< tab "Spark" >}}
+{{< tab "Spark3" >}}
+
+Requires Spark 3.2+.
+
+you can use `paimon_incremental_query` in query to extract the incremental data:

Review Comment:
   Should also add Extension and use SparkGenericCatalog?



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


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1541: [spark] Supports paimon_incremental_query Table Valued Function

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1541:
URL: https://github.com/apache/incubator-paimon/pull/1541#discussion_r1260480483


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonTableValuedFunctions.scala:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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
+
+import org.apache.paimon.CoreOptions
+import org.apache.paimon.spark.catalog.Catalogs
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.FunctionIdentifier
+import org.apache.spark.sql.catalyst.analysis.FunctionRegistryBase
+import org.apache.spark.sql.catalyst.analysis.TableFunctionRegistry.TableFunctionBuilder
+import org.apache.spark.sql.catalyst.expressions.{Attribute, Expression, ExpressionInfo}
+import org.apache.spark.sql.catalyst.plans.logical.{LeafNode, LogicalPlan}
+import org.apache.spark.sql.connector.catalog.Identifier
+import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation
+import org.apache.spark.sql.util.CaseInsensitiveStringMap
+
+import scala.collection.JavaConverters._
+
+object PaimonTableValuedFunctions {
+
+  val INCREMENTAL_QUERY = "paimon_incremental_query"

Review Comment:
   Dose this need to be `paimon_` prefix? Dose `incremental_query` work?
   How about Delta and Hudi?



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


[GitHub] [incubator-paimon] YannByron commented on a diff in pull request #1541: [spark] Supports paimon_incremental_query Table Valued Function

Posted by "YannByron (via GitHub)" <gi...@apache.org>.
YannByron commented on code in PR #1541:
URL: https://github.com/apache/incubator-paimon/pull/1541#discussion_r1260607152


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonTableValuedFunctions.scala:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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
+
+import org.apache.paimon.CoreOptions
+import org.apache.paimon.spark.catalog.Catalogs
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.FunctionIdentifier
+import org.apache.spark.sql.catalyst.analysis.FunctionRegistryBase
+import org.apache.spark.sql.catalyst.analysis.TableFunctionRegistry.TableFunctionBuilder
+import org.apache.spark.sql.catalyst.expressions.{Attribute, Expression, ExpressionInfo}
+import org.apache.spark.sql.catalyst.plans.logical.{LeafNode, LogicalPlan}
+import org.apache.spark.sql.connector.catalog.Identifier
+import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation
+import org.apache.spark.sql.util.CaseInsensitiveStringMap
+
+import scala.collection.JavaConverters._
+
+object PaimonTableValuedFunctions {
+
+  val INCREMENTAL_QUERY = "paimon_incremental_query"

Review Comment:
   Delta doesn't use the prefix, but Hudi does. It's better to have, to distinguish when more then one SparkSessionExtensions are used.



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


[GitHub] [incubator-paimon] JingsongLi merged pull request #1541: [spark] Supports paimon_incremental_query Table Valued Function

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #1541:
URL: https://github.com/apache/incubator-paimon/pull/1541


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