You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/01/01 14:25:10 UTC

[GitHub] [incubator-seatunnel] simon824 opened a new pull request #920: [SeaTunnel #919] Spark-hudi source plugin

simon824 opened a new pull request #920:
URL: https://github.com/apache/incubator-seatunnel/pull/920


   ## Purpose of this pull request
   Spark-hudi source plugin 
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] Change does not need document change, or I will submit document change to https://github.com/apache/incubator-seatunnel-website later
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] wuchunfu commented on a change in pull request #920: [SeaTunnel #919] Add spark-hudi source plugin

Posted by GitBox <gi...@apache.org>.
wuchunfu commented on a change in pull request #920:
URL: https://github.com/apache/incubator-seatunnel/pull/920#discussion_r777120066



##########
File path: seatunnel-connectors/seatunnel-connector-spark-hudi/src/main/scala/org/apache/seatunnel/spark/source/Hudi.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.seatunnel.spark.source
+
+import scala.collection.JavaConversions._
+
+import org.apache.seatunnel.common.config.CheckResult
+import org.apache.seatunnel.spark.SparkEnvironment
+import org.apache.seatunnel.spark.batch.SparkBatchSource
+import org.apache.spark.sql.{Dataset, Row}
+
+class Hudi extends SparkBatchSource {
+
+  override def prepare(env: SparkEnvironment): Unit = {}
+
+  override def checkConfig(): CheckResult = {
+    val requiredOptions = Seq("hoodie.datasource.read.paths")
+    var missingOptions = new StringBuilder
+    requiredOptions.map(opt =>
+      if (!config.hasPath(opt))
+        missingOptions.append(opt).append(","))

Review comment:
       If block needs braces




-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] CalvinKirs merged pull request #920: [SeaTunnel #919] Add spark-hudi source plugin

Posted by GitBox <gi...@apache.org>.
CalvinKirs merged pull request #920:
URL: https://github.com/apache/incubator-seatunnel/pull/920


   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] RickyHuo commented on a change in pull request #920: [SeaTunnel #919] Add spark-hudi source plugin

Posted by GitBox <gi...@apache.org>.
RickyHuo commented on a change in pull request #920:
URL: https://github.com/apache/incubator-seatunnel/pull/920#discussion_r777155123



##########
File path: docs/en/configuration/source-plugins/Hudi.md
##########
@@ -0,0 +1,25 @@
+# Source plugin: Hudi
+
+## Description
+
+Read data from Hudi.
+
+## Options
+
+| name           | type   | required | default value |
+| -------------- | ------ | -------- | ------------- |
+| [hoodie.datasource.read.paths](#hoodiedatasourcereadpaths-string)           | string | yes      | -             |
+
+Refer to [hudi read options](https://hudi.apache.org/docs/configurations/#Read-Options) for configurations.

Review comment:
       We can list `hoodie.*` in Options and show the reference below.




-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-seatunnel] simon824 commented on a change in pull request #920: [SeaTunnel #919] Add spark-hudi source plugin

Posted by GitBox <gi...@apache.org>.
simon824 commented on a change in pull request #920:
URL: https://github.com/apache/incubator-seatunnel/pull/920#discussion_r777183062



##########
File path: seatunnel-connectors/seatunnel-connector-spark-hudi/src/main/scala/org/apache/seatunnel/spark/source/Hudi.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.seatunnel.spark.source
+
+import scala.collection.JavaConversions._
+
+import org.apache.seatunnel.common.config.CheckResult
+import org.apache.seatunnel.spark.SparkEnvironment
+import org.apache.seatunnel.spark.batch.SparkBatchSource
+import org.apache.spark.sql.{Dataset, Row}
+
+class Hudi extends SparkBatchSource {
+
+  override def prepare(env: SparkEnvironment): Unit = {}
+
+  override def checkConfig(): CheckResult = {
+    val requiredOptions = Seq("hoodie.datasource.read.paths")
+    var missingOptions = new StringBuilder
+    requiredOptions.map(opt =>
+      if (!config.hasPath(opt))
+        missingOptions.append(opt).append(","))

Review comment:
       Updated, thx.

##########
File path: docs/en/configuration/source-plugins/Hudi.md
##########
@@ -0,0 +1,25 @@
+# Source plugin: Hudi
+
+## Description
+
+Read data from Hudi.
+
+## Options
+
+| name           | type   | required | default value |
+| -------------- | ------ | -------- | ------------- |
+| [hoodie.datasource.read.paths](#hoodiedatasourcereadpaths-string)           | string | yes      | -             |
+
+Refer to [hudi read options](https://hudi.apache.org/docs/configurations/#Read-Options) for configurations.

Review comment:
       Updated, thx.




-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org