Skip to content

Commit 073eadc

Browse files
committed
Change where UDF is mounted
1 parent b80b7d2 commit 073eadc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/user-defined-functions/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,13 @@ Next, we will create a container with our JAR mounted into it:
437437
438438
```shell
439439
podman run -it --rm --net=host \
440-
-v ~/currency-converter/target/currency-converter-1.0-SNAPSHOT.jar:/opt/flink/opt/currency-converter-1.0-SNAPSHOT.jar:Z \
440+
-v ~/currency-converter/target/currency-converter-1.0-SNAPSHOT.jar:/opt/currency-converter-1.0-SNAPSHOT.jar:Z \
441441
quay.io/streamshub/flink-sql-runner:0.2.0 \
442442
/opt/flink/bin/sql-client.sh embedded
443443
```
444444
445+
> Note: Flink [ships optional dependencies in `/opt`](https://nightlies.apache.org/flink/flink-docs-release-2.0/docs/dev/configuration/advanced/#anatomy-of-the-flink-distribution), so that's a good place to mount our JAR.
446+
445447
> Note: Don't forget the `:Z` at the end of the volume mount if using a system with SELinux! Otherwise, you will get a permission error when trying to use the JAR later.
446448
447449
Once we're in the Flink SQL CLI, we will first create a table for the generated international sales records:
@@ -477,7 +479,7 @@ If that worked, we can now register our UDF as a [temporary catalog function](ht
477479
```sql
478480
CREATE TEMPORARY FUNCTION currency_convert
479481
AS 'com.github.example.CurrencyConverter'
480-
USING JAR '/opt/flink/opt/currency-converter-1.0-SNAPSHOT.jar';
482+
USING JAR '/opt/currency-converter-1.0-SNAPSHOT.jar';
481483
```
482484

483485
> Note: Temporary catalog functions [only live as long as the current session](https://nightlies.apache.org/flink/flink-docs-release-2.0/docs/dev/table/functions/overview/#types-of-functions). You can omit the `TEMPORARY` keyword to create a catalog function that persists across sessions.

0 commit comments

Comments
 (0)