You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "harveyyue (via GitHub)" <gi...@apache.org> on 2024/03/22 11:15:12 UTC

[PR] Support tencent cloud COS storage [arrow-datafusion]

harveyyue opened a new pull request, #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   NA
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   ## What changes are included in this PR?
   Support `cos://` as schema
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ## Are these changes tested?
   yes, unit test
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## Are there any user-facing changes?
   no
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1535807632


##########
datafusion-cli/src/object_storage.rs:
##########
@@ -415,6 +424,15 @@ pub(crate) async fn get_object_store(
             let builder = get_oss_object_store_builder(url, options)?;
             Arc::new(builder.build()?)
         }
+        "cos" => {
+            let Some(options) = table_options.extensions.get::<AwsOptions>() else {

Review Comment:
   In follow up we need to refactor this part as for different schemas its too much of the common code



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage in `datafusion-cli` [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#issuecomment-2017945118

   Thanks again @harveyyue  and @comphead 


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage in `datafusion-cli` [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1535799020


##########
docs/source/user-guide/cli.md:
##########
@@ -380,6 +380,29 @@ The supported OPTIONS are:
 
 Note that the `endpoint` format of oss needs to be: `https://{bucket}.{oss-region-endpoint}`
 
+## Registering COS Data Sources
+
+[Tencent cloud COS](https://cloud.tencent.com/product/cos) data sources can be registered by executing a `CREATE EXTERNAL TABLE` SQL statement.
+
+```sql
+CREATE EXTERNAL TABLE test
+STORED AS PARQUET
+OPTIONS(
+    'aws.access_key_id' '******',
+    'aws.secret_access_key' '******',
+    'aws.cos.endpoint' 'https://cos.ap-singapore.myqcloud.com'
+)
+LOCATION 'cos://bucket/path/file.parquet';
+```
+
+The supported OPTIONS are:
+
+- access_key_id
+- secret_access_key
+- endpoint
+
+Note that the `endpoint` format of oss needs to be: `https://cos.{cos-region-endpoint}`

Review Comment:
   cos instead of oss?



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1535799548


##########
docs/source/user-guide/cli.md:
##########
@@ -388,7 +411,7 @@ Note that the `endpoint` format of oss needs to be: `https://{bucket}.{oss-regio
 CREATE EXTERNAL TABLE test
 STORED AS PARQUET
 OPTIONS(
-    'service_account_path' '/tmp/gcs.json',
+    'gcp.service_account_path' '/tmp/gcs.json',

Review Comment:
   is it related to cos onboard?



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "harveyyue (via GitHub)" <gi...@apache.org>.
harveyyue commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1536546576


##########
docs/source/user-guide/cli.md:
##########
@@ -380,6 +380,29 @@ The supported OPTIONS are:
 
 Note that the `endpoint` format of oss needs to be: `https://{bucket}.{oss-region-endpoint}`
 
+## Registering COS Data Sources
+
+[Tencent cloud COS](https://cloud.tencent.com/product/cos) data sources can be registered by executing a `CREATE EXTERNAL TABLE` SQL statement.
+
+```sql
+CREATE EXTERNAL TABLE test
+STORED AS PARQUET
+OPTIONS(
+    'aws.access_key_id' '******',
+    'aws.secret_access_key' '******',
+    'aws.cos.endpoint' 'https://cos.ap-singapore.myqcloud.com'
+)
+LOCATION 'cos://bucket/path/file.parquet';
+```
+
+The supported OPTIONS are:
+
+- access_key_id
+- secret_access_key
+- endpoint
+
+Note that the `endpoint` format of oss needs to be: `https://cos.{cos-region-endpoint}`

Review Comment:
   No, just add cos external table doc.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1536878232


##########
docs/source/user-guide/cli.md:
##########
@@ -380,6 +380,29 @@ The supported OPTIONS are:
 
 Note that the `endpoint` format of oss needs to be: `https://{bucket}.{oss-region-endpoint}`
 
+## Registering COS Data Sources
+
+[Tencent cloud COS](https://cloud.tencent.com/product/cos) data sources can be registered by executing a `CREATE EXTERNAL TABLE` SQL statement.
+
+```sql
+CREATE EXTERNAL TABLE test
+STORED AS PARQUET
+OPTIONS(
+    'aws.access_key_id' '******',
+    'aws.secret_access_key' '******',
+    'aws.cos.endpoint' 'https://cos.ap-singapore.myqcloud.com'
+)
+LOCATION 'cos://bucket/path/file.parquet';
+```
+
+The supported OPTIONS are:
+
+- access_key_id
+- secret_access_key
+- endpoint
+
+Note that the `endpoint` format of oss needs to be: `https://cos.{cos-region-endpoint}`

Review Comment:
   ```suggestion
   Note that the `endpoint` format of urls must be: `https://cos.{cos-region-endpoint}`
   ```



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "harveyyue (via GitHub)" <gi...@apache.org>.
harveyyue commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1536546953


##########
datafusion-cli/src/object_storage.rs:
##########
@@ -415,6 +424,15 @@ pub(crate) async fn get_object_store(
             let builder = get_oss_object_store_builder(url, options)?;
             Arc::new(builder.build()?)
         }
+        "cos" => {
+            let Some(options) = table_options.extensions.get::<AwsOptions>() else {

Review Comment:
   Yes, agree with you.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1536878468


##########
datafusion-cli/src/object_storage.rs:
##########
@@ -415,6 +424,15 @@ pub(crate) async fn get_object_store(
             let builder = get_oss_object_store_builder(url, options)?;
             Arc::new(builder.build()?)
         }
+        "cos" => {
+            let Some(options) = table_options.extensions.get::<AwsOptions>() else {

Review Comment:
   It would be great to file a ticket to do so 🙏 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] Support tencent cloud COS storage [arrow-datafusion]

Posted by "harveyyue (via GitHub)" <gi...@apache.org>.
harveyyue commented on code in PR #9734:
URL: https://github.com/apache/arrow-datafusion/pull/9734#discussion_r1536546747


##########
docs/source/user-guide/cli.md:
##########
@@ -388,7 +411,7 @@ Note that the `endpoint` format of oss needs to be: `https://{bucket}.{oss-regio
 CREATE EXTERNAL TABLE test
 STORED AS PARQUET
 OPTIONS(
-    'service_account_path' '/tmp/gcs.json',
+    'gcp.service_account_path' '/tmp/gcs.json',

Review Comment:
   No, add the missing prefix gcp and aws to related external table options.



-- 
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: github-unsubscribe@arrow.apache.org

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