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/10/25 13:09:54 UTC

[GitHub] [incubator-seatunnel] skyoct opened a new pull request, #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

skyoct opened a new pull request, #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   
   GoogleSheets source #3018
   
   ## Check list
   
   * [x] Code changed are covered with tests, or it does not need tests for reason:
   * [x] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [x] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   


-- 
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 commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1008613153


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,60 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "ewogIDJ0eXBlIjogInNlcnZpY2EfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAibW9vbi0zNjYzMDMiLAogICJwcml2YXRlX2tleV9pZCI6ICI3YjcxZjBhN2IxOTI4YTYxNWJhOWNiNjRlNDVkNzk0ZjI0YzIyZjczIiwKICAicHJpdmF0ZV9rZXkiOiAiLS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tXG5NSUlFdlFJQkFEQU5CZ2txaGtpRzl3MEJBUUVGQUFTQ0JLY3dnZ1NqQWdFQUFvSUJBUURuYzQwa0N5OS9vMHJlXG5TczV5SCtuSm05b3ZZTG9nUm1BeUdMU2I5KzFLWWVUM2JqRjk5VWdGSVc2UXR3MUl5Q3ZlRlBXaEkvK2VmMUJMXG5zVVN1WXA3VzdSckJDZEVsTzZJRVl0NklyMDR0aSt4eEtVa1hKa2x6dkY3RVh5VC9MbUdiWjZPZ3pURURSdDZ5XG5yZDhQOWVpR0M3eFQ2bnhpN05DNnd5OC9GZWpnRlBMS0p5U01ldU52M1k1OERINElWd0JkSkNPZ0l6cWFQcEhHXG54aUMzKzBzVCtpUmlnSEdUZWtlakZsenBWWnNuYzdpaENDV3UyNFZYNUpGVm1jQzVLMEhkVm1RWVliYmlRSUo2XG5sREZ2MHdpaWlFbDVpTW1pNkplT2lmalFCMjl5WU16WnNYWDhPVGY5R0xGbXNoQU83UUZrM1lDVGVnTDB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3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92MS9jZXJ0cyIsCiAgImNsaWVudF94NTA5X2NlcnRfdXJsIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFw
 aXMuY29tL3JvYm90L3YxL21ldGFkYXRhL3g1MDkvdGVzdGFwaSU0MG1vb24tMzY2MzAzLmlhbS5nc2VydmljZWFjY291bnQuY29tIgp9Cg=="

Review Comment:
   Do not use real parameters as examples



-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1014995035


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,80 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [ ] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [schema projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+- [ ] file format
+    - [ ] text
+    - [ ] csv
+    - [ ] json
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "seatunnel-test"
+    sheet_id = "1VI0DvyZK-NIdssSdsDSsSSSC-_-rYMi7ppJiI_jhE"
+    sheet_name = "sheets01"
+    range = "A1:C3"
+    headers = ["a", "b", "c"]
+    schema = {
+      fields {
+        a = int
+        b = string
+        c = string

Review Comment:
   > headers and fields#key are duplicated define, can you remove headers?
   
   Header specifies the name of each column in the table,Is orderly.But fields # key is unordered. 
   I think it should be irreplaceable



-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1008718401


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,60 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "ewogIDJ0eXBlIjogInNlcnZpY2EfYWNjb3VudCIsCiAgInByb2plY3RfaWQi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WxYOUtrTW9GXG55R2ZFcHJCNG5UYlJhbUd5U25LRTZxdGZlRW1IT3JxZ3FXeTNlZHNmQW9HQVp0STlFV3ljVDA2cnpvOVMrK3hVXG41RGdrZnkyZUI1T052MmJGV1hGY1k1eHI1bUsxN0FOT0E0TnZRZlJLcHEzR1RvZzNKKzFIcXhKQnRNamdHNFIvXG5tV3c2amZtdFIzdWJiK0FnTWptKy9NbllWYzJrcncreHlDeStLMW5pZE4vMzF5ZTlrNk50dC9nSjhxNUt6ZFN2XG5RNnhVdXN4OWRkN3ZBZVdWYWhOUU9VQT1cbi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS1cbiIsCiAgImNsaWVudF9lbWFpbCI6ICJ0ZXN0YXBpQG1vb24tMzY2MzAzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwKICAiY2xpZW50X2lkIjogIjExNzQ1MDI0NDQ4ODY1NzcyNDg4MiIsCiAgImF1dGhfdXJpIjogImh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi9hdXRoIiwKICAidG9rZW5fdXJpIjogImh0dHBzOi8vb2F1dGgyLmdvb2dsZWFwaXMuY29tL3Rva2VuIiwKICAiYXV0aF9wcm92aWRlcl94NTA5X2NlcnRfdXJsIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92MS9jZXJ0cyIsCiAgImNsaWVudF94NTA5X2NlcnRfdXJsIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFw
 aXMuY29tL3JvYm90L3YxL21ldGFkYXRhL3g1MDkvdGVzdGFwaSU0MG1vb24tMzY2MzAzLmlhbS5nc2VydmljZWFjY291bnQuY29tIgp9Cg=="

Review Comment:
   <img width="771" alt="image" src="https://user-images.githubusercontent.com/24541857/198840047-1af44825-d1ea-4a4b-b1a1-f503cbee2844.png">
   @TaoZex this is ok?



-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1016672502


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,80 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [ ] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [schema projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+- [ ] file format
+    - [ ] text
+    - [ ] csv
+    - [ ] json
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "seatunnel-test"
+    sheet_id = "1VI0DvyZK-NIdssSdsDSsSSSC-_-rYMi7ppJiI_jhE"
+    sheet_name = "sheets01"
+    range = "A1:C3"
+    headers = ["a", "b", "c"]
+    schema = {
+      fields {
+        a = int
+        b = string
+        c = string

Review Comment:
   > > > headers and fields#key are duplicated define, can you remove headers?
   > > 
   > > 
   > > Header specifies the name of each column in the table,Is orderly.But fields # key is unordered. I think it should be irreplaceable
   > 
   > @skyoct
   > 
   > reference to here, use SeaTunnelSchema to keep fields#key order
   > 
   > https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/schema/SeaTunnelSchema.java#L207
   
   Ok, 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


[GitHub] [incubator-seatunnel] EricJoy2048 merged pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
EricJoy2048 merged PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185


-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1005645376


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,61 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | List<String> | yes      | -             |
+| schema              | config       | No       | -             |
+
+

Review Comment:
   @TaoZex Do not need to set the type?



-- 
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] hailin0 commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
hailin0 commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1016625140


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,80 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [ ] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [schema projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+- [ ] file format
+    - [ ] text
+    - [ ] csv
+    - [ ] json
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "seatunnel-test"
+    sheet_id = "1VI0DvyZK-NIdssSdsDSsSSSC-_-rYMi7ppJiI_jhE"
+    sheet_name = "sheets01"
+    range = "A1:C3"
+    headers = ["a", "b", "c"]
+    schema = {
+      fields {
+        a = int
+        b = string
+        c = string

Review Comment:
   > > headers and fields#key are duplicated define, can you remove headers?
   > 
   > Header specifies the name of each column in the table,Is orderly.But fields # key is unordered. I think it should be irreplaceable
   
   @skyoct 
   
   reference to here, use SeaTunnelSchema to keep fields#key order
   
   https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/schema/SeaTunnelSchema.java#L207



-- 
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] TaoZex commented on pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
TaoZex commented on PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#issuecomment-1293329858

   > > Thanks for your contribution. Please add release doc like this : #3201 Also, put a screenshot to prove that the connector functions fine.
   > 
   > @TaoZex
   > 
   > This screenshot Flink ![image](https://user-images.githubusercontent.com/24541857/198259722-b67b09f5-d226-45af-947e-a390489abd26.png) Spark ![image](https://user-images.githubusercontent.com/24541857/198260741-49af360c-d94f-4503-8e04-67030a34a2f9.png)
   > 
   > Do I think release files should be added by professionals? Because I don't know how to fill in the "Supported Version"`
   
   @EricJoy2048 Do we need to add release files?


-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1005645974


##########
seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/source/SheetsSource.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.connectors.seatunnel.google.sheets.source;
+
+import org.apache.seatunnel.api.common.PrepareFailException;
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.connectors.seatunnel.common.schema.SeaTunnelSchema;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitSource;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.google.sheets.config.SheetsParameters;
+import org.apache.seatunnel.format.json.JsonDeserializationSchema;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(SeaTunnelSource.class)
+public class SheetsSource extends AbstractSingleSplitSource<SeaTunnelRow> {
+
+    private SeaTunnelRowType seaTunnelRowType;
+
+    private SheetsParameters sheetsParameters;
+
+    private DeserializationSchema<SeaTunnelRow> deserializationSchema;
+
+    @Override
+    public String getPluginName() {
+        return "GoogleSheets";
+    }
+
+    @Override
+    public void prepare(Config pluginConfig) throws PrepareFailException {
+        this.sheetsParameters = new SheetsParameters().buildWithConfig(pluginConfig);

Review Comment:
   I will add it, 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


[GitHub] [incubator-seatunnel] TaoZex commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
TaoZex commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1005650673


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,61 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | List<String> | yes      | -             |
+| schema              | config       | No       | -             |
+
+

Review Comment:
   > @TaoZex Do not need to set the type?
   
   Just leave a blank line,so you can delete line 19.



-- 
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] skyoct commented on pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#issuecomment-1293321704

   > Thanks for your contribution. Please add release doc like this : #3201 Also, put a screenshot to prove that the connector functions fine.
   
   @TaoZex 
   
   This screenshot
   Flink
   ![image](https://user-images.githubusercontent.com/24541857/198259722-b67b09f5-d226-45af-947e-a390489abd26.png)
   Spark
   ![image](https://user-images.githubusercontent.com/24541857/198260741-49af360c-d94f-4503-8e04-67030a34a2f9.png)
   
   Do I think release files should be added by professionals? Because I don't know how to fill in the "Supported Version"`
   


-- 
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] TaoZex commented on pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
TaoZex commented on PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#issuecomment-1293080888

   Thanks for your contribution.
   Please add release doc like this : https://github.com/apache/incubator-seatunnel/pull/3201
   Also, put a screenshot to prove that the connector functions fine.


-- 
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] hailin0 commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
hailin0 commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1014960087


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,80 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [ ] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [schema projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+- [ ] file format
+    - [ ] text
+    - [ ] csv
+    - [ ] json
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "seatunnel-test"
+    sheet_id = "1VI0DvyZK-NIdssSdsDSsSSSC-_-rYMi7ppJiI_jhE"
+    sheet_name = "sheets01"
+    range = "A1:C3"
+    headers = ["a", "b", "c"]
+    schema = {
+      fields {
+        a = int
+        b = string
+        c = string

Review Comment:
   headers and fields#key are duplicated define, can you remove headers?



-- 
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] EricJoy2048 commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1011159796


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,60 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "seatunnel-test"
+    sheet_id = "1VI0DvyZK-NIdssSdsDSsSSSC-_-rYMi7ppJiI_jhE"
+    sheet_name = "sheets01"
+    range = "A1:C3"
+    headers = ["a", "b", "c"]
+    schema = {
+      fields {
+        a: int
+        b: string
+        c: string
+      }
+    }
+  }
+```

Review Comment:
   Please add `changed log` reference https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/connector-v2/source/SftpFile.md#next-version



-- 
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] EricJoy2048 commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1011160952


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,60 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description

Review Comment:
   Please add `Source Key Features` reference https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/connector-v2/source/SftpFile.md#key-features



-- 
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] hailin0 commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
hailin0 commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1013633331


##########
seatunnel-connectors-v2/connector-google-sheets/pom.xml:
##########
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>seatunnel-connectors-v2</artifactId>
+        <groupId>org.apache.seatunnel</groupId>
+        <version>${revision}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>connector-google-sheets</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>connector-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>seatunnel-format-json</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.apis</groupId>
+            <artifactId>google-api-services-sheets</artifactId>
+            <version>v4-rev612-1.25.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.auth</groupId>
+            <artifactId>google-auth-library-oauth2-http</artifactId>
+            <version>1.3.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>31.1-android</version>
+        </dependency>
+
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.1.0</version>

Review Comment:
   remove version 



##########
seatunnel-connectors-v2/connector-google-sheets/pom.xml:
##########
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>seatunnel-connectors-v2</artifactId>
+        <groupId>org.apache.seatunnel</groupId>
+        <version>${revision}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>connector-google-sheets</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>connector-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.seatunnel</groupId>
+            <artifactId>seatunnel-format-json</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.apis</groupId>
+            <artifactId>google-api-services-sheets</artifactId>
+            <version>v4-rev612-1.25.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.auth</groupId>
+            <artifactId>google-auth-library-oauth2-http</artifactId>
+            <version>1.3.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>31.1-android</version>
+        </dependency>
+
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.1.0</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.common</pattern>
+                                    <shadedPattern>my_guava.common</shadedPattern>

Review Comment:
   ```suggestion
                                       <shadedPattern>${seatunnel.shade.package}.google.sheets.com.google.common</shadedPattern>
   ```



##########
seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/source/SheetsSourceReader.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.connectors.seatunnel.google.sheets.source;
+
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.google.sheets.config.SheetsParameters;
+
+import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
+import com.google.api.client.http.HttpRequestInitializer;
+import com.google.api.client.http.javanet.NetHttpTransport;
+import com.google.api.client.json.JsonFactory;
+import com.google.api.client.json.gson.GsonFactory;
+import com.google.api.services.sheets.v4.Sheets;
+import com.google.api.services.sheets.v4.SheetsScopes;
+import com.google.api.services.sheets.v4.model.ValueRange;
+import com.google.auth.http.HttpCredentialsAdapter;
+import com.google.auth.oauth2.ServiceAccountCredentials;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SheetsSourceReader extends AbstractSingleSplitReader<SeaTunnelRow> {
+
+    private SheetsParameters sheetsParameters;
+
+    private HttpRequestInitializer requestInitializer;
+
+    private static final String APPLICATION_NAME = "SeaTunnel Google Sheets";
+
+    private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
+
+    private final SingleSplitReaderContext context;
+
+    private DeserializationSchema<SeaTunnelRow> deserializationSchema;
+
+    public SheetsSourceReader(SheetsParameters sheetsParameters, SingleSplitReaderContext context, DeserializationSchema<SeaTunnelRow> deserializationSchema) throws IOException {
+        this.sheetsParameters = sheetsParameters;
+        this.context = context;
+        this.deserializationSchema = deserializationSchema;
+    }
+
+    @Override
+    public void open() throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(sheetsParameters.getServiceAccountKey());
+        ServiceAccountCredentials sourceCredentials = ServiceAccountCredentials
+            .fromStream(new ByteArrayInputStream(keyBytes));
+        sourceCredentials = (ServiceAccountCredentials) sourceCredentials
+            .createScoped(Collections.singletonList(SheetsScopes.SPREADSHEETS));
+        requestInitializer = new HttpCredentialsAdapter(sourceCredentials);
+
+    }
+
+    @Override
+    public void close() throws IOException {
+
+    }
+
+    @Override
+    public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
+        final NetHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
+        Sheets service = new Sheets.Builder(httpTransport, JSON_FACTORY, requestInitializer)
+            .setApplicationName(APPLICATION_NAME)
+            .build();
+        ValueRange response = service.spreadsheets().values()
+            .get(sheetsParameters.getSheetId(), sheetsParameters.getSheetName() + "!" + sheetsParameters.getRange())
+            .execute();
+        List<List<Object>> values = response.getValues();
+        if (values != null) {
+            for (List<Object> row : values) {
+                Map<String, Object> data = new HashMap<>();
+                for (int i = 0; i < row.size(); i++) {
+                    String key = i + "";
+                    if (sheetsParameters != null && i < sheetsParameters.getHeaders().size()) {
+                        if (!sheetsParameters.getHeaders().get(i).equals("")) {
+                            key = sheetsParameters.getHeaders().get(i);
+                        }
+                    }
+                    data.put(key, row.get(i));
+                }
+                String dataStr = JsonUtils.toJsonString(data);
+                deserializationSchema.deserialize(dataStr.getBytes(), output);

Review Comment:
   Thx. you should implement `GoogleSheetsDeserialization` yourself.
   
   GoogleSheetsDeserialization using `seaTunnelRowType` to convert `List<Object> row` to SeaTunnelRow



##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,60 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "seatunnel-test"
+    sheet_id = "1VI0DvyZK-NIdssSdsDSsSSSC-_-rYMi7ppJiI_jhE"
+    sheet_name = "sheets01"
+    range = "A1:C3"
+    headers = ["a", "b", "c"]
+    schema = {
+      fields {
+        a: int
+        b: string
+        c: string

Review Comment:
   Should use `=` ?
   
   example 
   a = int



-- 
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] TaoZex commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
TaoZex commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1005558408


##########
seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/source/SheetsSource.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.connectors.seatunnel.google.sheets.source;
+
+import org.apache.seatunnel.api.common.PrepareFailException;
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.connectors.seatunnel.common.schema.SeaTunnelSchema;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitSource;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.google.sheets.config.SheetsParameters;
+import org.apache.seatunnel.format.json.JsonDeserializationSchema;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(SeaTunnelSource.class)
+public class SheetsSource extends AbstractSingleSplitSource<SeaTunnelRow> {
+
+    private SeaTunnelRowType seaTunnelRowType;
+
+    private SheetsParameters sheetsParameters;
+
+    private DeserializationSchema<SeaTunnelRow> deserializationSchema;
+
+    @Override
+    public String getPluginName() {
+        return "GoogleSheets";
+    }
+
+    @Override
+    public void prepare(Config pluginConfig) throws PrepareFailException {
+        this.sheetsParameters = new SheetsParameters().buildWithConfig(pluginConfig);

Review Comment:
   need parameter check



##########
seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/source/SheetsSourceReader.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.connectors.seatunnel.google.sheets.source;
+
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.google.sheets.config.SheetsParameters;
+
+import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
+import com.google.api.client.http.HttpRequestInitializer;
+import com.google.api.client.http.javanet.NetHttpTransport;
+import com.google.api.client.json.JsonFactory;
+import com.google.api.client.json.gson.GsonFactory;
+import com.google.api.services.sheets.v4.Sheets;
+import com.google.api.services.sheets.v4.SheetsScopes;
+import com.google.api.services.sheets.v4.model.ValueRange;
+import com.google.auth.http.HttpCredentialsAdapter;
+import com.google.auth.oauth2.ServiceAccountCredentials;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SheetsSourceReader extends AbstractSingleSplitReader<SeaTunnelRow> {
+
+    private SheetsParameters sheetsParameters;
+
+    private HttpRequestInitializer requestInitializer;
+
+    private static final String APPLICATION_NAME = "SeaTunnel Google Sheets";
+
+    private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
+
+    private final SingleSplitReaderContext context;
+
+    private DeserializationSchema<SeaTunnelRow> deserializationSchema;
+
+    public SheetsSourceReader(SheetsParameters sheetsParameters, SingleSplitReaderContext context, DeserializationSchema<SeaTunnelRow> deserializationSchema) throws IOException {
+        this.sheetsParameters = sheetsParameters;
+        this.context = context;
+        this.deserializationSchema = deserializationSchema;
+    }
+
+    @Override
+    public void open() throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(sheetsParameters.getServiceAccountKey());
+        ServiceAccountCredentials sourceCredentials = ServiceAccountCredentials
+            .fromStream(new ByteArrayInputStream(keyBytes));
+        sourceCredentials = (ServiceAccountCredentials) sourceCredentials
+            .createScoped(Collections.singletonList(SheetsScopes.SPREADSHEETS));
+        requestInitializer = new HttpCredentialsAdapter(sourceCredentials);
+
+    }
+
+    @Override
+    public void close() throws IOException {
+

Review Comment:
   Do we need to close service?



##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,61 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | List<String> | yes      | -             |
+| schema              | config       | No       | -             |
+
+

Review Comment:
   delete this line



-- 
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] TaoZex commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
TaoZex commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1008716789


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,60 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "ewogIDJ0eXBlIjogInNlcnZpY2EfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAibW9vbi0zNjYzMDMiLAogICJwcml2YXRlX2tleV9pZCI6ICI3YjcxZjBhN2IxOTI4YTYxNWJhOWNiNjRlNDVkNzk0ZjI0YzIyZjczIiwKICAicHJpdmF0ZV9rZXkiOiAiLS0tLS1CRUdJTiBQUkl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nZRZlJLcHEzR1RvZzNKKzFIcXhKQnRNamdHNFIvXG5tV3c2amZtdFIzdWJiK0FnTWptKy9NbllWYzJrcncreHlDeStLMW5pZE4vMzF5ZTlrNk50dC9nSjhxNUt6ZFN2XG5RNnhVdXN4OWRkN3ZBZVdWYWhOUU9VQT1cbi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS1cbiIsCiAgImNsaWVudF9lbWFpbCI6ICJ0ZXN0YXBpQG1vb24tMzY2MzAzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwKICAiY2xpZW50X2lkIjogIjExNzQ1MDI0NDQ4ODY1NzcyNDg4MiIsCiAgImF1dGhfdXJpIjogImh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi9hdXRoIiwKICAidG9rZW5fdXJpIjogImh0dHBzOi8vb2F1dGgyLmdvb2dsZWFwaXMuY29tL3Rva2VuIiwKICAiYXV0aF9wcm92aWRlcl94NTA5X2NlcnRfdXJsIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92MS9jZXJ0cyIsCiAgImNsaWVudF94NTA5X2NlcnRfdXJsIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFw
 aXMuY29tL3JvYm90L3YxL21ldGFkYXRhL3g1MDkvdGVzdGFwaSU0MG1vb24tMzY2MzAzLmlhbS5nc2VydmljZWFjY291bnQuY29tIgp9Cg=="

Review Comment:
   > @CalvinKirs This parameter cannot be run in real life
   
   We often use key like "Seatunnel-test"



-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1008716003


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,60 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "ewogIDJ0eXBlIjogInNlcnZpY2EfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAibW9vbi0zNjYzMDMiLAogICJwcml2YXRlX2tleV9pZCI6ICI3YjcxZjBhN2IxOTI4YTYxNWJhOWNiNjRlNDVkNzk0ZjI0YzIyZjczIiwKICAicHJpdmF0ZV9rZXkiOiAiLS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tXG5NSUlFdlFJQkFEQU5CZ2txaGtpRzl3MEJBUUVGQUFTQ0JLY3dnZ1NqQWdFQUFvSUJBUURuYzQwa0N5OS9vMHJlXG5TczV5SCtuSm05b3ZZTG9nUm1BeUdMU2I5KzFLWWVUM2JqRjk5VWdGSVc2UXR3MUl5Q3ZlRlBXaEkvK2VmMUJMXG5zVVN1WXA3VzdSckJDZEVsTzZJRVl0NklyMDR0aSt4eEtVa1hKa2x6dkY3RVh5VC9MbUdiWjZPZ3pURURSdDZ5XG5yZDhQOWVpR0M3eFQ2bnhpN05DNnd5OC9GZWpnRlBMS0p5U01ldU52M1k1OERINElWd0JkSkNPZ0l6cWFQcEhHXG54aUMzKzBzVCtpUmlnSEdUZWtlakZsenB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hdXRoIiwKICAidG9rZW5fdXJpIjogImh0dHBzOi8vb2F1dGgyLmdvb2dsZWFwaXMuY29tL3Rva2VuIiwKICAiYXV0aF9wcm92aWRlcl94NTA5X2NlcnRfdXJsIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92MS9jZXJ0cyIsCiAgImNsaWVudF94NTA5X2NlcnRfdXJsIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFw
 aXMuY29tL3JvYm90L3YxL21ldGFkYXRhL3g1MDkvdGVzdGFwaSU0MG1vb24tMzY2MzAzLmlhbS5nc2VydmljZWFjY291bnQuY29tIgp9Cg=="

Review Comment:
   @CalvinKirs This parameter cannot be run in real life



-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1005643770


##########
seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/source/SheetsSourceReader.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.connectors.seatunnel.google.sheets.source;
+
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.google.sheets.config.SheetsParameters;
+
+import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
+import com.google.api.client.http.HttpRequestInitializer;
+import com.google.api.client.http.javanet.NetHttpTransport;
+import com.google.api.client.json.JsonFactory;
+import com.google.api.client.json.gson.GsonFactory;
+import com.google.api.services.sheets.v4.Sheets;
+import com.google.api.services.sheets.v4.SheetsScopes;
+import com.google.api.services.sheets.v4.model.ValueRange;
+import com.google.auth.http.HttpCredentialsAdapter;
+import com.google.auth.oauth2.ServiceAccountCredentials;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SheetsSourceReader extends AbstractSingleSplitReader<SeaTunnelRow> {
+
+    private SheetsParameters sheetsParameters;
+
+    private HttpRequestInitializer requestInitializer;
+
+    private static final String APPLICATION_NAME = "SeaTunnel Google Sheets";
+
+    private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
+
+    private final SingleSplitReaderContext context;
+
+    private DeserializationSchema<SeaTunnelRow> deserializationSchema;
+
+    public SheetsSourceReader(SheetsParameters sheetsParameters, SingleSplitReaderContext context, DeserializationSchema<SeaTunnelRow> deserializationSchema) throws IOException {
+        this.sheetsParameters = sheetsParameters;
+        this.context = context;
+        this.deserializationSchema = deserializationSchema;
+    }
+
+    @Override
+    public void open() throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(sheetsParameters.getServiceAccountKey());
+        ServiceAccountCredentials sourceCredentials = ServiceAccountCredentials
+            .fromStream(new ByteArrayInputStream(keyBytes));
+        sourceCredentials = (ServiceAccountCredentials) sourceCredentials
+            .createScoped(Collections.singletonList(SheetsScopes.SPREADSHEETS));
+        requestInitializer = new HttpCredentialsAdapter(sourceCredentials);
+
+    }
+
+    @Override
+    public void close() throws IOException {
+

Review Comment:
   The official document does not find that the service needs to be closed.



-- 
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] skyoct commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
skyoct commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1005643770


##########
seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/source/SheetsSourceReader.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.connectors.seatunnel.google.sheets.source;
+
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.google.sheets.config.SheetsParameters;
+
+import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
+import com.google.api.client.http.HttpRequestInitializer;
+import com.google.api.client.http.javanet.NetHttpTransport;
+import com.google.api.client.json.JsonFactory;
+import com.google.api.client.json.gson.GsonFactory;
+import com.google.api.services.sheets.v4.Sheets;
+import com.google.api.services.sheets.v4.SheetsScopes;
+import com.google.api.services.sheets.v4.model.ValueRange;
+import com.google.auth.http.HttpCredentialsAdapter;
+import com.google.auth.oauth2.ServiceAccountCredentials;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SheetsSourceReader extends AbstractSingleSplitReader<SeaTunnelRow> {
+
+    private SheetsParameters sheetsParameters;
+
+    private HttpRequestInitializer requestInitializer;
+
+    private static final String APPLICATION_NAME = "SeaTunnel Google Sheets";
+
+    private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
+
+    private final SingleSplitReaderContext context;
+
+    private DeserializationSchema<SeaTunnelRow> deserializationSchema;
+
+    public SheetsSourceReader(SheetsParameters sheetsParameters, SingleSplitReaderContext context, DeserializationSchema<SeaTunnelRow> deserializationSchema) throws IOException {
+        this.sheetsParameters = sheetsParameters;
+        this.context = context;
+        this.deserializationSchema = deserializationSchema;
+    }
+
+    @Override
+    public void open() throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(sheetsParameters.getServiceAccountKey());
+        ServiceAccountCredentials sourceCredentials = ServiceAccountCredentials
+            .fromStream(new ByteArrayInputStream(keyBytes));
+        sourceCredentials = (ServiceAccountCredentials) sourceCredentials
+            .createScoped(Collections.singletonList(SheetsScopes.SPREADSHEETS));
+        requestInitializer = new HttpCredentialsAdapter(sourceCredentials);
+
+    }
+
+    @Override
+    public void close() throws IOException {
+

Review Comment:
   @TaoZex The official document does not find that the service needs to be closed.



##########
seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/source/SheetsSource.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.connectors.seatunnel.google.sheets.source;
+
+import org.apache.seatunnel.api.common.PrepareFailException;
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SeaTunnelSource;
+import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.connectors.seatunnel.common.schema.SeaTunnelSchema;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitSource;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+import org.apache.seatunnel.connectors.seatunnel.google.sheets.config.SheetsParameters;
+import org.apache.seatunnel.format.json.JsonDeserializationSchema;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(SeaTunnelSource.class)
+public class SheetsSource extends AbstractSingleSplitSource<SeaTunnelRow> {
+
+    private SeaTunnelRowType seaTunnelRowType;
+
+    private SheetsParameters sheetsParameters;
+
+    private DeserializationSchema<SeaTunnelRow> deserializationSchema;
+
+    @Override
+    public String getPluginName() {
+        return "GoogleSheets";
+    }
+
+    @Override
+    public void prepare(Config pluginConfig) throws PrepareFailException {
+        this.sheetsParameters = new SheetsParameters().buildWithConfig(pluginConfig);

Review Comment:
   @TaoZex I will add it, 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


[GitHub] [incubator-seatunnel] hailin0 commented on a diff in pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
hailin0 commented on code in PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#discussion_r1016625140


##########
docs/en/connector-v2/source/GoogleSheets.md:
##########
@@ -0,0 +1,80 @@
+# GoogleSheets
+
+> GoogleSheets source connector
+
+## Description
+
+Used to read data from GoogleSheets.
+
+## Key features
+
+- [x] [batch](../../concept/connector-v2-features.md)
+- [ ] [stream](../../concept/connector-v2-features.md)
+- [ ] [exactly-once](../../concept/connector-v2-features.md)
+- [x] [schema projection](../../concept/connector-v2-features.md)
+- [ ] [parallelism](../../concept/connector-v2-features.md)
+- [ ] [support user-defined split](../../concept/connector-v2-features.md)
+- [ ] file format
+    - [ ] text
+    - [ ] csv
+    - [ ] json
+
+## Options
+
+| name                | type         | required | default value |
+|-------------------  |--------------|----------|---------------|
+| service_account_key | string       | yes      | -             |
+| sheet_id            | string       | yes      | -             |
+| sheet_name          | string       | yes      | -             |
+| headers             | array        | yes      | -             |
+| schema              | config       | yes      | -             |
+
+### service_account_key [string]
+
+google cloud service account, base64 required
+
+### sheet_id [string]
+
+sheet id in a Google Sheets URL
+
+### sheet_name [string]
+
+the name of the sheet you want to import
+
+### headers [array]
+
+as column name
+
+### schema [config]
+
+#### fields [config]
+
+the schema fields of upstream data
+
+## Example
+
+simple:
+
+```hocon
+  GoogleSheets {
+    service_account_key = "seatunnel-test"
+    sheet_id = "1VI0DvyZK-NIdssSdsDSsSSSC-_-rYMi7ppJiI_jhE"
+    sheet_name = "sheets01"
+    range = "A1:C3"
+    headers = ["a", "b", "c"]
+    schema = {
+      fields {
+        a = int
+        b = string
+        c = string

Review Comment:
   > > headers and fields#key are duplicated define, can you remove headers?
   > 
   > Header specifies the name of each column in the table,Is orderly.But fields # key is unordered. I think it should be irreplaceable
   
   reference to here, use SeaTunnelSchema to keep fields#key order
   
   https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/schema/SeaTunnelSchema.java#L207



-- 
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] EricJoy2048 commented on pull request #3185: [Feature][Connector-V2][GoogleSheets] Support GoogleSheets Source

Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on PR #3185:
URL: https://github.com/apache/incubator-seatunnel/pull/3185#issuecomment-1299551972

   > 
   
   Don't worry, I will update `release state` doc while release.


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