spark3 flink1.19 配置paimon0.9 jdbc metastore

时间:2024-07-10 07:08:29

flink

(base) thomas990p@thomas990p bin % cat sql-client-paimon-streaming-mode.sh 

sql-client.sh -i paimon-catalog-streaming.sql

(base) thomas990p@thomas990p bin % cat paimon-catalog-streaming.sql

CREATE CATALOG my_catalog WITH (

    'type'='paimon',

    'warehouse'='file:/Users/thomas990p/data/paimon',

  'lock.enabled' = 'true',

  'metastore' = 'jdbc',

  'uri' = 'jdbc:mysql://localhost:3306/default?user=root&password=123123123'

 -- 'uri' = 'jdbc:sqlite:/Users/thomas990p/database/sqlite_test1.db'

);

USE CATALOG my_catalog;

SET 'sql-client.execution.result-mode' = 'tableau';

SET 'execution.runtime-mode' = 'streaming';

spark

注意uri加引号:

spark-sql -i paimon.sql \

    --conf spark.sql.catalog.paimon=org.apache.paimon.spark.SparkCatalog \

    --conf spark.sql.catalog.paimon.warehouse=file:/Users/thomas990p/data/paimon \

    --conf spark.sql.extensions=org.apache.paimon.spark.extensions.PaimonSparkSessionExtensions \

    --conf spark.sql.catalog.paimon.lock.enable=true \

    --conf spark.sql.catalog.paimon.metastore=jdbc \

    --conf spark.sql.catalog.paimon.uri='jdbc:mysql://localhost:3306/default?user=root&password=123123123'

(base) thomas990p@thomas990p bin % cat paimon.sql 

use paimon;