-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[filesystems]Support Tencent COSN (#842) #843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| --- | ||
| title: "COSN" | ||
| weight: 3 | ||
| type: docs | ||
| aliases: | ||
| - /filesystems/cosn.html | ||
| --- | ||
| <!-- | ||
| 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. | ||
| --> | ||
|
|
||
| # COSN | ||
|
|
||
| {{< stable >}} | ||
|
|
||
| Download [paimon-cosn-{{< version >}}.jar](https://www.apache.org/dyn/closer.lua/flink/paimon-{{< version >}}/paimon-cosn-{{< version >}}.jar). | ||
|
|
||
| {{< /stable >}} | ||
|
|
||
| {{< unstable >}} | ||
|
|
||
| Download [paimon-cosn-{{< version >}}.jar](https://repository.apache.org/snapshots/org/apache/paimon/paimon-cosn/{{< version >}}/). | ||
|
|
||
| {{< /unstable >}} | ||
|
|
||
| {{< tabs "cosn" >}} | ||
|
|
||
| {{< tab "Flink" >}} | ||
|
|
||
| {{< hint info >}} | ||
| If you have already configured cosn access through Flink (Via Flink FileSystem), here you can skip the following configuration. | ||
| {{< /hint >}} | ||
|
|
||
| Put `paimon-cosn-{{< version >}}.jar` into `lib` directory of your Flink home, and create catalog: | ||
|
|
||
| ```sql | ||
| CREATE CATALOG my_catalog WITH ( | ||
| 'type' = 'paimon', | ||
| 'warehouse' = 'cosn://path/to/warehouse', | ||
| 'fs.cosn.bucket.region' = 'ap-city', | ||
| 'fs.cosn.userinfo.secretId' = 'xxx', | ||
| 'fs.cosn.userinfo.secretKey' = 'yyy' | ||
| ); | ||
| ``` | ||
|
|
||
| {{< /tab >}} | ||
|
|
||
| {{< tab "Spark" >}} | ||
|
|
||
| {{< hint info >}} | ||
| If you have already configured cosn access through Spark (Via Hadoop FileSystem), here you can skip the following configuration. | ||
| {{< /hint >}} | ||
|
|
||
| Place `paimon-cosn-{{< version >}}.jar` together with `paimon-spark-{{< version >}}.jar` under Spark's jars directory, and start like | ||
|
|
||
| ```shell | ||
| spark-sql \ | ||
| --conf spark.sql.catalog.paimon=org.apache.paimon.spark.SparkCatalog \ | ||
| --conf spark.sql.catalog.paimon.warehouse=cosn://<bucket-name>/ \ | ||
| --conf spark.sql.catalog.paimon.fs.cosn.bucket.region=ap-city \ | ||
| --conf spark.sql.catalog.paimon.fs.cosn.userinfo.secretId=xxx \ | ||
| --conf spark.sql.catalog.paimon.fs.cosn.userinfo.secretKey=yyy | ||
| ``` | ||
|
|
||
| {{< /tab >}} | ||
|
|
||
| {{< tab "Hive" >}} | ||
|
|
||
| {{< hint info >}} | ||
| If you have already configured cosn access through Hive (Via Hadoop FileSystem), here you can skip the following configuration. | ||
| {{< /hint >}} | ||
|
|
||
| NOTE: You need to ensure that Hive metastore can access `cosn`. | ||
|
|
||
| Place `paimon-cosn-{{< version >}}.jar` together with `paimon-hive-connector-{{< version >}}.jar` under Hive's auxlib directory, and start like | ||
|
|
||
| ```sql | ||
| SET paimon.fs.cosn.bucket.region=ap-city; | ||
| SET paimon.fs.cosn.userinfo.secretId=xxx; | ||
| SET paimon.fs.cosn.userinfo.secretKey=yyy; | ||
| ``` | ||
|
|
||
| And read table from hive metastore, table can be created by Flink or Spark, see [Catalog with Hive Metastore]({{< ref "how-to/creating-catalogs" >}}) | ||
| ```sql | ||
| SELECT * FROM test_table; | ||
| SELECT COUNT(1) FROM test_table; | ||
| ``` | ||
|
|
||
| {{< /tab >}} | ||
|
|
||
| {{< tab "Trino" >}} | ||
|
|
||
| Place `paimon-cosn-{{< version >}}.jar` together with `paimon-trino-{{< version >}}.jar` under `plugin/paimon` directory. | ||
|
|
||
| Add options in `etc/catalog/paimon.properties`. | ||
| ```shell | ||
| fs.cosn.bucket.region=ap-city | ||
| fs.cosn.userinfo.secretId=xxx | ||
| fs.cosn.userinfo.secretKey=yyy | ||
| ``` | ||
|
|
||
| {{< /tab >}} | ||
|
|
||
| {{< /tabs >}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| <?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"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <artifactId>paimon-filesystems</artifactId> | ||
| <groupId>org.apache.paimon</groupId> | ||
| <version>0.4-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>paimon-cosn-impl</artifactId> | ||
| <name>Paimon : FileSystems : COSN : Impl</name> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <properties> | ||
| <fs.cosn.sdk.version>3.3.5</fs.cosn.sdk.version> | ||
| <fs.cosn.api.version>5.6.139</fs.cosn.api.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.apache.paimon</groupId> | ||
| <artifactId>paimon-common</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.apache.paimon</groupId> | ||
| <artifactId>paimon-hadoop-shaded</artifactId> | ||
| <version>${project.version}</version> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.apache.hadoop</groupId> | ||
| <artifactId>hadoop-cos</artifactId> | ||
| <version>${fs.cosn.sdk.version}</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <!-- provided by flink-fs-hadoop-shaded --> | ||
| <groupId>org.apache.hadoop</groupId> | ||
| <artifactId>hadoop-common</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>ch.qos.reload4j</groupId> | ||
| <artifactId>reload4j</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>org.slf4j</groupId> | ||
| <artifactId>slf4j-reload4j</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.qcloud</groupId> | ||
| <artifactId>cos_api</artifactId> | ||
| <version>${fs.cosn.api.version}</version> | ||
| </dependency> | ||
|
|
||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
|
|
||
| <!-- Relocate all COSN related classes --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>shade-paimon</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>shade</goal> | ||
| </goals> | ||
| <configuration> | ||
| <artifactSet> | ||
| <includes> | ||
| <include>*:*</include> | ||
| </includes> | ||
| </artifactSet> | ||
| <relocations> | ||
| <relocation> | ||
| <pattern>org.apache.hadoop</pattern> | ||
| <shadedPattern>org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop</shadedPattern> | ||
| </relocation> | ||
| </relocations> | ||
| <filters> | ||
| <filter> | ||
| <artifact>*</artifact> | ||
| <excludes> | ||
| <exclude>.gitkeep</exclude> | ||
| <exclude>mime.types</exclude> | ||
| <exclude>mozilla/**</exclude> | ||
| </excludes> | ||
| </filter> | ||
| <filter> | ||
| <artifact>*:*</artifact> | ||
| <excludes> | ||
| <exclude>META-INF/*.SF</exclude> | ||
| <exclude>META-INF/*.DSA</exclude> | ||
| <exclude>META-INF/*.RSA</exclude> | ||
| </excludes> | ||
| </filter> | ||
| </filters> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| </project> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.