openinx opened a new pull request #3725:
URL: https://github.com/apache/iceberg/pull/3725


   ## Flink1.13 Example: 
   
   * Start the Flink SQL cilent: 
   
   ```bash
   wget https://gosspublic.alicdn.com/sdks/java/aliyun_java_sdk_3.10.2.zip
   unzip aliyun_java_sdk_3.10.2.zip
   
   # Download from 
https://www.apache.org/dyn/closer.lua/flink/flink-1.13.3/flink-1.13.3-bin-scala_2.12.tgz
   FLINK_HOME=/path/to/flink-release
   # Downlaod from 
https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-flink-runtime
   FLINK_RUNTIME_LIB=/path/to/iceberg-flink-runtime-1.14-0.13.0-SNAPSHOT.jar
   #  Download from 
https://repo.maven.apache.org/maven2/org/apache/flink/flink-sql-connector-hive-2.3.6_2.11/1.13.3/flink-sql-connector-hive-2.3.6_2.11-1.13.3.jar
   HIVE_METASTORE_LIB=/path/to/flink-sql-connector-hive-2.3.6_2.12-1.13.2.jar
   
   DEPS="-j $FLINK_RUNTIME_LIB -j $HIVE_METASTORE_LIB"
   for dep in `find aliyun_java_sdk_3.10.2 -type f -name '*.jar'`; do
     DEPS="$DEPS -j $dep"
   done
   
   eval "$FLINK_HOME/bin/sql-client.sh embedded $DEPS shell"
   ```
   * Execute the flink SQL:
   ```sql
   CREATE CATALOG hive WITH (
       'type' = 'iceberg',
       'uri' = 'thrift://localhost:9083',
       'warehouse' = 'oss://iceberg-test/warehouse',
       'io-impl' = 'org.apache.iceberg.aliyun.oss.OSSFileIO',
       'oss.endpoint' = 'oss-cn-hangzhou.aliyuncs.com',
       'client.access-key-id' = '******',
       'client.access-key-secret' = '******'
   );
   CREATE TABLE `hive`.`default`.`sample` (
       id   BIGINT,
       data STRING
   ) WITH (
       'engine.hive.enabled' = 'true'
   );
   INSERT INTO `hive`.`default`.`sample` VALUES (1, 'AAA');
   
   SELECT * FROM sample;
   +----+------+
   | id | data |
   +----+------+
   |  1 |  AAA |
   +----+------+
   1 row in set
   ```
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to