Skip to content

Commit

Permalink
S3 file sink sample update.
Browse files Browse the repository at this point in the history
Added instruction on how to test s3 sink locally using PyFlink.
Minor update to the sample code.
  • Loading branch information
Qing Liu committed Feb 7, 2023
1 parent fa4107a commit b5a5730
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 7 additions & 0 deletions pyflink-examples/StreamingFileSink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# PyFlink local testing - adding file system support for S3 buckets

In order to test S3 file sink locally, please add S3 file system plugin to PyFlink `lib` directory.

1. Download S3 file system implementation such as S3 FS Hadoop from Maven repository [here](https://mvnrepository.com/artifact/org.apache.flink/flink-s3-fs-hadoop). (Please pick a version that matches your apache-flink version.)
2. Copy the downloaded jar file (e.g. flink-s3-fs-hadoop-1.15.2.jar) to PyFlink `lib` directory.
1. For miniconda3, the directory is at `~/miniconda3/envs/local-kda-env/lib/python3.8/site-packages/pyflink/lib/`
4 changes: 1 addition & 3 deletions pyflink-examples/StreamingFileSink/streaming-file-sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
"pipeline.jars",
"file:///"
+ CURRENT_DIR
+ "/lib/flink-sql-connector-kinesis-1.15.2.jar;file:///"
+ CURRENT_DIR
+ "/plugins/flink-s3-fs-hadoop/flink-s3-fs-hadoop-1.13.2.jar",
+ "/lib/flink-sql-connector-kinesis-1.15.2.jar"
)

table_env.get_config().get_configuration().set_string(
Expand Down

0 comments on commit b5a5730

Please sign in to comment.