Skip to content

Commit

Permalink
fix: remove LANGUAGE python from the examples on external python ud…
Browse files Browse the repository at this point in the history
…f doc (#231)

`LANGUAGE` option is not needed for external UDFs.
  • Loading branch information
stdrc authored Feb 12, 2025
1 parent 8e9764d commit 0129817
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sql/udfs/use-udfs-in-python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,20 @@ Here are the SQL statements for declaring the four UDFs defined in [step 2](#2-d

```sql
CREATE FUNCTION gcd(int, int) RETURNS int
LANGUAGE python AS gcd USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.
AS gcd
USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.

CREATE FUNCTION blocking(int) RETURNS int
LANGUAGE python AS blocking USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.
AS blocking
USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.

CREATE FUNCTION key_value(varchar) RETURNS struct<key varchar, value varchar> -- the field names must exactly match the ones in Python decorator
LANGUAGE python AS key_value USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.
AS key_value
USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.

CREATE FUNCTION series(int) RETURNS TABLE (x int)
LANGUAGE python AS series USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.
AS series
USING LINK 'http://localhost:8815'; -- If you are running RisingWave using Docker, replace the address with 'http://host.docker.internal:8815'.
```

## 5\. Use your functions in RisingWave
Expand Down

0 comments on commit 0129817

Please sign in to comment.