From 75b69ec33250b70a36f12e74cdd69b7e4160ed96 Mon Sep 17 00:00:00 2001 From: John Fallows Date: Tue, 1 Oct 2024 12:07:00 -0700 Subject: [PATCH 1/6] Update CHANGELOG.md --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 234388ab9b..ca073a26f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [0.9.96](https://github.com/aklivity/zilla/tree/0.9.96) (2024-10-01) + +[Full Changelog](https://github.com/aklivity/zilla/compare/0.9.95...0.9.96) + +**Implemented enhancements:** + +- Support Kafka topics create, alter, delete [\#1059](https://github.com/aklivity/zilla/issues/1059) + +**Fixed bugs:** + +- `zilla` Fails to Load Configuration from Specified location if the initial attempts are unsuccessful [\#1226](https://github.com/aklivity/zilla/issues/1226) + +**Merged pull requests:** + +- Risingwave SInk primary key fix [\#1273](https://github.com/aklivity/zilla/pull/1273) ([akrambek](https://github.com/akrambek)) +- Risingwave and PsqlKafka bug fixes [\#1272](https://github.com/aklivity/zilla/pull/1272) ([akrambek](https://github.com/akrambek)) +- create external function issue fix [\#1271](https://github.com/aklivity/zilla/pull/1271) ([ankitk-me](https://github.com/ankitk-me)) +- Remove produceRecordFramingSize constraints [\#1270](https://github.com/aklivity/zilla/pull/1270) ([akrambek](https://github.com/akrambek)) +- External header pattern fix [\#1269](https://github.com/aklivity/zilla/pull/1269) ([ankitk-me](https://github.com/ankitk-me)) +- Detect config update after initial 404 status [\#1267](https://github.com/aklivity/zilla/pull/1267) ([jfallows](https://github.com/jfallows)) +- Support Kafka topics alter, delete [\#1265](https://github.com/aklivity/zilla/pull/1265) ([akrambek](https://github.com/akrambek)) + ## [0.9.95](https://github.com/aklivity/zilla/tree/0.9.95) (2024-09-23) [Full Changelog](https://github.com/aklivity/zilla/compare/0.9.94...0.9.95) From 4e250e74367e6694a0afcc3526c1ea5671192d61 Mon Sep 17 00:00:00 2001 From: Akram Yakubov Date: Thu, 3 Oct 2024 16:37:26 -0700 Subject: [PATCH 2/6] Support insert into to seed kafka messages via risingwave binding (#1275) --- .../client.rpt | 2 +- .../server.rpt | 2 +- .../client.rpt | 0 .../server.rpt | 0 .../client.rpt | 0 .../server.rpt | 0 .../client.rpt | 123 ++++++++++++++-- .../server.rpt | 135 +++++++++++++++--- .../create.table.with.primary.key/client.rpt | 108 +++++++++++++- .../create.table.with.primary.key/server.rpt | 124 +++++++++++++--- .../query.with.multiple.statements/client.rpt | 108 +++++++++++++- .../query.with.multiple.statements/server.rpt | 122 ++++++++++++++-- .../client.rpt | 6 +- .../server.rpt | 6 +- .../client.rpt | 4 +- .../server.rpt | 4 +- .../client.rpt | 8 +- .../server.rpt | 8 +- .../client.rpt | 2 +- .../server.rpt | 2 +- .../risingwave/streams/EffectiveIT.java | 18 +-- .../binding/risingwave/streams/PgsqlIT.java | 16 +-- .../config/RisingwaveBindingConfig.java | 3 +- .../config/RisingwaveCommandType.java | 1 + .../statement/RisingwaveCommandTemplate.java | 14 +- ...ingwaveCreateMaterializedViewTemplate.java | 41 +++++- .../RisingwaveCreateSinkTemplate.java | 28 +++- .../RisingwaveCreateSourceTemplate.java | 33 ++++- .../RisingwaveCreateTableTemplate.java | 56 +++----- .../RisingwaveCreateTopicTemplate.java | 26 ++++ .../statement/RisingwaveSqlCommandParser.java | 2 +- .../stream/RisingwaveCompletionCommand.java | 1 + .../stream/RisingwaveProxyFactory.java | 64 ++++++++- .../risingwave/internal/stream/ProxyIT.java | 18 +-- 34 files changed, 912 insertions(+), 173 deletions(-) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/{create.table.with.includes => create.stream.with.includes}/client.rpt (98%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/{create.table.with.includes => create.stream.with.includes}/server.rpt (98%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/{create.table => create.stream}/client.rpt (100%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/{create.table => create.stream}/server.rpt (100%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/{create.tables => create.streams}/client.rpt (100%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/{create.tables => create.streams}/server.rpt (100%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/{create.table.with.includes => create.stream.with.includes}/client.rpt (93%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/{create.table.with.includes => create.stream.with.includes}/server.rpt (93%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/{create.table => create.stream}/client.rpt (94%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/{create.table => create.stream}/server.rpt (95%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/{create.tables => create.streams}/client.rpt (92%) rename incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/{create.tables => create.streams}/server.rpt (92%) diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.includes/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream.with.includes/client.rpt similarity index 98% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.includes/client.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream.with.includes/client.rpt index 10aa0d39ab..679a78508e 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.includes/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream.with.includes/client.rpt @@ -34,8 +34,8 @@ write zilla:data.ext ${pgsql:dataEx() .build()} write "CREATE SOURCE IF NOT EXISTS weather (*)\n" "INCLUDE header 'zilla:correlation-id' AS correlation_id\n" + "INCLUDE header 'zilla:identity' AS identity\n" "INCLUDE timestamp AS timestamp\n" - "INCLUDE header 'zilla:identity' AS owner_id\n" "WITH (\n" " connector='kafka',\n" " properties.bootstrap.server='localhost:9092',\n" diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.includes/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream.with.includes/server.rpt similarity index 98% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.includes/server.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream.with.includes/server.rpt index ff8e4dec8c..9871eea900 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.includes/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream.with.includes/server.rpt @@ -38,8 +38,8 @@ read zilla:data.ext ${pgsql:dataEx() .build()} read "CREATE SOURCE IF NOT EXISTS weather (*)\n" "INCLUDE header 'zilla:correlation-id' AS correlation_id\n" + "INCLUDE header 'zilla:identity' AS identity\n" "INCLUDE timestamp AS timestamp\n" - "INCLUDE header 'zilla:identity' AS owner_id\n" "WITH (\n" " connector='kafka',\n" " properties.bootstrap.server='localhost:9092',\n" diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream/client.rpt similarity index 100% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table/client.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream/client.rpt diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream/server.rpt similarity index 100% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table/server.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.stream/server.rpt diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.tables/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.streams/client.rpt similarity index 100% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.tables/client.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.streams/client.rpt diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.tables/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.streams/server.rpt similarity index 100% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.tables/server.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.streams/server.rpt diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/client.rpt index f9451bc7bb..7c587a897b 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/client.rpt @@ -32,14 +32,10 @@ write zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -write "CREATE TABLE IF NOT EXISTS cities (\n" - " *,\n" - " PRIMARY KEY (id)\n" - ")\n" - "INCLUDE KEY AS key\n" - "INCLUDE header 'zilla:correlation-id' AS correlation_id\n" +write "CREATE SOURCE IF NOT EXISTS cities_source (*)\n" + "INCLUDE header 'zilla:correlation-id' AS zilla_correlation_id_header\n" + "INCLUDE header 'zilla:identity' AS zilla_identity_header\n" "INCLUDE timestamp AS timestamp\n" - "INCLUDE header 'zilla:identity' AS owner_id\n" "WITH (\n" " connector='kafka',\n" " properties.bootstrap.server='localhost:9092',\n" @@ -50,7 +46,60 @@ write "CREATE TABLE IF NOT EXISTS cities (\n" " schema.registry = 'http://localhost:8081'\n" ");" [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SOURCE") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE MATERIALIZED VIEW IF NOT EXISTS cities_view AS" + " SELECT id, name, description," + " COALESCE(correlation_id, zilla_correlation_id_header::varchar) as correlation_id," + " COALESCE(identity, zilla_identity_header::varchar) as identity," + " timestamp" + " FROM cities_source;" + [0x00] +write flush +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_MATERIALIZED_VIEW") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE TABLE IF NOT EXISTS cities" + " (id VARCHAR, name VARCHAR, description VARCHAR," + " correlation_id VARCHAR, identity VARCHAR, timestamp TIMESTAMP," + " PRIMARY KEY (id));" + [0x00] write flush read advised zilla:flush ${pgsql:flushEx() @@ -67,12 +116,65 @@ read advised zilla:flush ${pgsql:flushEx() .build() .build()} +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE SINK cities_view_sink INTO cities FROM cities_view;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE SINK cities_sink\n" + "FROM cities\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " primary_key='id'\n" + ") FORMAT UPSERT ENCODE AVRO (\n" + " schema.registry='http://localhost:8081'\n" + ") KEY ENCODE TEXT;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} connect "zilla://streams/app2" option zilla:window 8192 option zilla:transmission "duplex" - write zilla:begin.ext ${pgsql:beginEx() .typeId(zilla:id("pgsql")) .parameter("user", "root") @@ -89,7 +191,9 @@ write zilla:data.ext ${pgsql:dataEx() .build() .build()} write "CREATE TOPIC IF NOT EXISTS cities " - "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));" + "(id VARCHAR, name VARCHAR, description VARCHAR," + " correlation_id VARCHAR, identity VARCHAR, timestamp TIMESTAMP," + " PRIMARY KEY (id));" [0x00] write flush @@ -106,4 +210,3 @@ read advised zilla:flush ${pgsql:flushEx() .status("IDLE") .build() .build()} - diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/server.rpt index 189026d000..4bc34b76a3 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key.and.includes/server.rpt @@ -36,29 +36,130 @@ read zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -read "CREATE TABLE IF NOT EXISTS cities (\n" - " *,\n" - " PRIMARY KEY (id)\n" - ")\n" - "INCLUDE KEY AS key\n" - "INCLUDE header 'zilla:correlation-id' AS correlation_id\n" - "INCLUDE timestamp AS timestamp\n" - "INCLUDE header 'zilla:identity' AS owner_id\n" +read "CREATE SOURCE IF NOT EXISTS cities_source (*)\n" + "INCLUDE header 'zilla:correlation-id' AS zilla_correlation_id_header\n" + "INCLUDE header 'zilla:identity' AS zilla_identity_header\n" + "INCLUDE timestamp AS timestamp\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " scan.startup.mode='latest',\n" + " scan.startup.timestamp.millis='140000000'\n" + ") FORMAT PLAIN ENCODE AVRO (\n" + " schema.registry = 'http://localhost:8081'\n" + ");" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SOURCE") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE MATERIALIZED VIEW IF NOT EXISTS cities_view AS" + " SELECT id, name, description," + " COALESCE(correlation_id, zilla_correlation_id_header::varchar) as correlation_id," + " COALESCE(identity, zilla_identity_header::varchar) as identity," + " timestamp" + " FROM cities_source;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_MATERIALIZED_VIEW") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE TABLE IF NOT EXISTS cities" + " (id VARCHAR, name VARCHAR, description VARCHAR," + " correlation_id VARCHAR, identity VARCHAR, timestamp TIMESTAMP," + " PRIMARY KEY (id));" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_TABLE") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE SINK cities_view_sink INTO cities FROM cities_view;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE SINK cities_sink\n" + "FROM cities\n" "WITH (\n" " connector='kafka',\n" " properties.bootstrap.server='localhost:9092',\n" " topic='dev.cities',\n" - " scan.startup.mode='latest',\n" - " scan.startup.timestamp.millis='140000000'\n" - ") FORMAT PLAIN ENCODE AVRO (\n" - " schema.registry = 'http://localhost:8081'\n" - ");" + " primary_key='id'\n" + ") FORMAT UPSERT ENCODE AVRO (\n" + " schema.registry='http://localhost:8081'\n" + ") KEY ENCODE TEXT;" [0x00] write advise zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_SINK") .build() .build()} @@ -91,7 +192,9 @@ read zilla:data.ext ${pgsql:dataEx() .build() .build()} read "CREATE TOPIC IF NOT EXISTS cities " - "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));" + "(id VARCHAR, name VARCHAR, description VARCHAR," + " correlation_id VARCHAR, identity VARCHAR, timestamp TIMESTAMP," + " PRIMARY KEY (id));" [0x00] write advise zilla:flush ${pgsql:flushEx() @@ -109,5 +212,3 @@ write advise zilla:flush ${pgsql:flushEx() .status("IDLE") .build() .build()} - - diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/client.rpt index be60e5fe79..b5829feab7 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/client.rpt @@ -32,11 +32,7 @@ write zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -write "CREATE TABLE IF NOT EXISTS cities (\n" - " *,\n" - " PRIMARY KEY (id)\n" - ")\n" - "INCLUDE KEY AS key\n" +write "CREATE SOURCE IF NOT EXISTS cities_source (*)\n" "WITH (\n" " connector='kafka',\n" " properties.bootstrap.server='localhost:9092',\n" @@ -47,7 +43,53 @@ write "CREATE TABLE IF NOT EXISTS cities (\n" " schema.registry = 'http://localhost:8081'\n" ");" [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SOURCE") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE MATERIALIZED VIEW IF NOT EXISTS cities_view AS SELECT * FROM cities_source;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_MATERIALIZED_VIEW") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE TABLE IF NOT EXISTS cities " + "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));" + [0x00] write flush read advised zilla:flush ${pgsql:flushEx() @@ -64,12 +106,65 @@ read advised zilla:flush ${pgsql:flushEx() .build() .build()} +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE SINK cities_view_sink INTO cities FROM cities_view;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE SINK cities_sink\n" + "FROM cities\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " primary_key='id'\n" + ") FORMAT UPSERT ENCODE AVRO (\n" + " schema.registry='http://localhost:8081'\n" + ") KEY ENCODE TEXT;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} connect "zilla://streams/app2" option zilla:window 8192 option zilla:transmission "duplex" - write zilla:begin.ext ${pgsql:beginEx() .typeId(zilla:id("pgsql")) .parameter("user", "root") @@ -103,4 +198,3 @@ read advised zilla:flush ${pgsql:flushEx() .status("IDLE") .build() .build()} - diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/server.rpt index 8d2121373d..11d987ffc1 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.table.with.primary.key/server.rpt @@ -36,20 +36,61 @@ read zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -read "CREATE TABLE IF NOT EXISTS cities (\n" - " *,\n" - " PRIMARY KEY (id)\n" - ")\n" - "INCLUDE KEY AS key\n" - "WITH (\n" - " connector='kafka',\n" - " properties.bootstrap.server='localhost:9092',\n" - " topic='dev.cities',\n" - " scan.startup.mode='latest',\n" - " scan.startup.timestamp.millis='140000000'\n" - ") FORMAT PLAIN ENCODE AVRO (\n" - " schema.registry = 'http://localhost:8081'\n" - ");" +read "CREATE SOURCE IF NOT EXISTS cities_source (*)\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " scan.startup.mode='latest',\n" + " scan.startup.timestamp.millis='140000000'\n" + ") FORMAT PLAIN ENCODE AVRO (\n" + " schema.registry = 'http://localhost:8081'\n" + ");" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SOURCE") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE MATERIALIZED VIEW IF NOT EXISTS cities_view AS SELECT * FROM cities_source;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_MATERIALIZED_VIEW") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE TABLE IF NOT EXISTS cities " + "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));" [0x00] write advise zilla:flush ${pgsql:flushEx() @@ -66,6 +107,59 @@ write advise zilla:flush ${pgsql:flushEx() .build() .build()} +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE SINK cities_view_sink INTO cities FROM cities_view;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE SINK cities_sink\n" + "FROM cities\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " primary_key='id'\n" + ") FORMAT UPSERT ENCODE AVRO (\n" + " schema.registry='http://localhost:8081'\n" + ") KEY ENCODE TEXT;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + accept "zilla://streams/app2" option zilla:window 8192 option zilla:transmission "duplex" @@ -106,5 +200,3 @@ write advise zilla:flush ${pgsql:flushEx() .status("IDLE") .build() .build()} - - diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/client.rpt index ab484b7434..98a4b465ce 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/client.rpt @@ -32,11 +32,7 @@ write zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -write "CREATE TABLE IF NOT EXISTS cities (\n" - " *,\n" - " PRIMARY KEY (id)\n" - ")\n" - "INCLUDE KEY AS key\n" +write "CREATE SOURCE IF NOT EXISTS cities_source (*)\n" "WITH (\n" " connector='kafka',\n" " properties.bootstrap.server='localhost:9092',\n" @@ -49,6 +45,53 @@ write "CREATE TABLE IF NOT EXISTS cities (\n" [0x00] write flush +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SOURCE") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE MATERIALIZED VIEW IF NOT EXISTS cities_view AS SELECT * FROM cities_source;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_MATERIALIZED_VIEW") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE TABLE IF NOT EXISTS cities " + "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));" + [0x00] +write flush + read advised zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() @@ -63,6 +106,61 @@ read advised zilla:flush ${pgsql:flushEx() .build() .build()} +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE SINK cities_view_sink INTO cities FROM cities_view;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE SINK cities_sink\n" + "FROM cities\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " primary_key='id'\n" + ") FORMAT UPSERT ENCODE AVRO (\n" + " schema.registry='http://localhost:8081'\n" + ") KEY ENCODE TEXT;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + write zilla:data.ext ${pgsql:dataEx() .typeId(zilla:id("pgsql")) .query() diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/server.rpt index 39350568c4..b3378e42e4 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/query.with.multiple.statements/server.rpt @@ -36,20 +36,61 @@ read zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -read "CREATE TABLE IF NOT EXISTS cities (\n" - " *,\n" - " PRIMARY KEY (id)\n" - ")\n" - "INCLUDE KEY AS key\n" - "WITH (\n" - " connector='kafka',\n" - " properties.bootstrap.server='localhost:9092',\n" - " topic='dev.cities',\n" - " scan.startup.mode='latest',\n" - " scan.startup.timestamp.millis='140000000'\n" - ") FORMAT PLAIN ENCODE AVRO (\n" - " schema.registry = 'http://localhost:8081'\n" - ");" +read "CREATE SOURCE IF NOT EXISTS cities_source (*)\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " scan.startup.mode='latest',\n" + " scan.startup.timestamp.millis='140000000'\n" + ") FORMAT PLAIN ENCODE AVRO (\n" + " schema.registry = 'http://localhost:8081'\n" + ");" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SOURCE") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE MATERIALIZED VIEW IF NOT EXISTS cities_view AS SELECT * FROM cities_source;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_MATERIALIZED_VIEW") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE TABLE IF NOT EXISTS cities " + "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id));" [0x00] write advise zilla:flush ${pgsql:flushEx() @@ -66,6 +107,59 @@ write advise zilla:flush ${pgsql:flushEx() .build() .build()} +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE SINK cities_view_sink INTO cities FROM cities_view;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE SINK cities_sink\n" + "FROM cities\n" + "WITH (\n" + " connector='kafka',\n" + " properties.bootstrap.server='localhost:9092',\n" + " topic='dev.cities',\n" + " primary_key='id'\n" + ") FORMAT UPSERT ENCODE AVRO (\n" + " schema.registry='http://localhost:8081'\n" + ") KEY ENCODE TEXT;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_SINK") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + read zilla:data.ext ${pgsql:dataEx() .typeId(zilla:id("pgsql")) .query() diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.includes/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream.with.includes/client.rpt similarity index 93% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.includes/client.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream.with.includes/client.rpt index 7529d60a4b..dbb1c245b7 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.includes/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream.with.includes/client.rpt @@ -32,10 +32,10 @@ write zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -write "CREATE TABLE IF NOT EXISTS weather " +write "CREATE STREAM IF NOT EXISTS weather " "(city VARCHAR, temperature DOUBLE, date DATE)\n" "INCLUDE zilla_correlation_id AS correlation_id\n" - "INCLUDE zilla_identity AS owner_id\n" + "INCLUDE zilla_identity AS identity\n" "INCLUDE timestamp as timestamp;" [0x00] @@ -44,7 +44,7 @@ write flush read advised zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.includes/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream.with.includes/server.rpt similarity index 93% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.includes/server.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream.with.includes/server.rpt index bf70fb8462..19833142cf 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.includes/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream.with.includes/server.rpt @@ -36,17 +36,17 @@ read zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -read "CREATE TABLE IF NOT EXISTS weather " +read "CREATE STREAM IF NOT EXISTS weather " "(city VARCHAR, temperature DOUBLE, date DATE)\n" "INCLUDE zilla_correlation_id AS correlation_id\n" - "INCLUDE zilla_identity AS owner_id\n" + "INCLUDE zilla_identity AS identity\n" "INCLUDE timestamp as timestamp;" [0x00] write advise zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream/client.rpt similarity index 94% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table/client.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream/client.rpt index f13127bff9..245b79577a 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream/client.rpt @@ -32,7 +32,7 @@ write zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -write "CREATE TABLE IF NOT EXISTS weather " +write "CREATE STREAM IF NOT EXISTS weather " "(city VARCHAR, temperature DOUBLE, date DATE);" [0x00] @@ -41,7 +41,7 @@ write flush read advised zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream/server.rpt similarity index 95% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table/server.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream/server.rpt index 2e2cc77ca9..45dc55a0b7 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.stream/server.rpt @@ -36,14 +36,14 @@ read zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -read "CREATE TABLE IF NOT EXISTS weather " +read "CREATE STREAM IF NOT EXISTS weather " "(city VARCHAR, temperature DOUBLE, date DATE);" [0x00] write advise zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.tables/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.streams/client.rpt similarity index 92% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.tables/client.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.streams/client.rpt index be9c1b188e..044b7660a5 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.tables/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.streams/client.rpt @@ -32,7 +32,7 @@ write zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -write "CREATE TABLE IF NOT EXISTS weather_c " +write "CREATE STREAM IF NOT EXISTS weather_c " "(city VARCHAR, temperature DOUBLE, date DATE);" [0x00] @@ -41,7 +41,7 @@ write flush read advised zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} @@ -57,7 +57,7 @@ write zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -write "CREATE TABLE IF NOT EXISTS weather_f " +write "CREATE STREAM IF NOT EXISTS weather_f " "(city VARCHAR, temperature DOUBLE, date DATE);" [0x00] @@ -66,7 +66,7 @@ write flush read advised zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.tables/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.streams/server.rpt similarity index 92% rename from incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.tables/server.rpt rename to incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.streams/server.rpt index 8ec0dc1570..f852dbdb84 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.tables/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.streams/server.rpt @@ -36,14 +36,14 @@ read zilla:data.ext ${pgsql:dataEx() .query() .build() .build()} -read "CREATE TABLE IF NOT EXISTS weather_c " +read "CREATE STREAM IF NOT EXISTS weather_c " "(city VARCHAR, temperature DOUBLE, date DATE);" [0x00] write advise zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} @@ -54,14 +54,14 @@ write advise zilla:flush ${pgsql:flushEx() .build() .build()} -read "CREATE TABLE IF NOT EXISTS weather_f " +read "CREATE STREAM IF NOT EXISTS weather_f " "(city VARCHAR, temperature DOUBLE, date DATE);" [0x00] write advise zilla:flush ${pgsql:flushEx() .typeId(zilla:id("pgsql")) .completion() - .tag("CREATE_TABLE") + .tag("CREATE_STREAM") .build() .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/client.rpt index d7aab69d57..f40e1041f9 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/client.rpt @@ -35,7 +35,7 @@ write zilla:data.ext ${pgsql:dataEx() write "CREATE TABLE IF NOT EXISTS cities " "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id))\n" "INCLUDE zilla_correlation_id AS correlation_id\n" - "INCLUDE zilla_identity AS owner_id\n" + "INCLUDE zilla_identity AS identity\n" "INCLUDE timestamp as timestamp;" [0x00] diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/server.rpt index 1b3abad6af..ed5fda502c 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.table.with.primary.key.and.includes/server.rpt @@ -39,7 +39,7 @@ read zilla:data.ext ${pgsql:dataEx() read "CREATE TABLE IF NOT EXISTS cities " "(id VARCHAR, name VARCHAR, description VARCHAR, PRIMARY KEY (id))\n" "INCLUDE zilla_correlation_id AS correlation_id\n" - "INCLUDE zilla_identity AS owner_id\n" + "INCLUDE zilla_identity AS identity\n" "INCLUDE timestamp as timestamp;" [0x00] diff --git a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java index d1b671d511..b2a3a4dff1 100644 --- a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java +++ b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java @@ -48,10 +48,10 @@ public void shouldCreateTableWithPrimaryKey() throws Exception @Test @Specification({ - "${app}/create.table/client", - "${app}/create.table/server" + "${app}/create.stream/client", + "${app}/create.stream/server" }) - public void shouldCreateTable() throws Exception + public void shouldCreateStream() throws Exception { k3po.finish(); } @@ -107,9 +107,9 @@ public void shouldCreateFunctionEmbedded() throws Exception @Test @Specification({ - "${app}/create.table.with.includes/client", - "${app}/create.table.with.includes/server" }) - public void shouldCreateTableWithIncludes() throws Exception + "${app}/create.stream.with.includes/client", + "${app}/create.stream.with.includes/server" }) + public void shouldCreateStreamWithIncludes() throws Exception { k3po.finish(); } @@ -134,9 +134,9 @@ public void shouldShowTablesWithNewline() throws Exception @Test @Specification({ - "${app}/create.tables/client", - "${app}/create.tables/server" }) - public void shouldCreateTables() throws Exception + "${app}/create.streams/client", + "${app}/create.streams/server" }) + public void shouldCreateStreams() throws Exception { k3po.finish(); } diff --git a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java index 7227533b33..ceb626e751 100644 --- a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java +++ b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java @@ -48,10 +48,10 @@ public void shouldCreateTableWithPrimaryKey() throws Exception @Test @Specification({ - "${app}/create.table/client", - "${app}/create.table/server" + "${app}/create.stream/client", + "${app}/create.stream/server" }) - public void shouldCreateTable() throws Exception + public void shouldCreateStream() throws Exception { k3po.finish(); } @@ -107,9 +107,9 @@ public void shouldCreateFunctionEmbedded() throws Exception @Test @Specification({ - "${app}/create.table.with.includes/client", - "${app}/create.table.with.includes/server" }) - public void shouldCreateTableWithIncludes() throws Exception + "${app}/create.stream.with.includes/client", + "${app}/create.stream.with.includes/server" }) + public void shouldCreateStreamWithIncludes() throws Exception { k3po.finish(); } @@ -134,8 +134,8 @@ public void shouldShowTablesWithNewline() throws Exception @Test @Specification({ - "${app}/create.tables/client", - "${app}/create.tables/server" }) + "${app}/create.streams/client", + "${app}/create.streams/server" }) public void shouldCreateTables() throws Exception { k3po.finish(); diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java index 602e124808..20431d5e40 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java @@ -81,8 +81,7 @@ public RisingwaveBindingConfig( udf = options.udfs.get(0); } - this.createTable = new RisingwaveCreateTableTemplate(bootstrapServer, - location, config.kafkaScanStartupTimestampMillis()); + this.createTable = new RisingwaveCreateTableTemplate(); this.createSource = new RisingwaveCreateSourceTemplate(bootstrapServer, location, config.kafkaScanStartupTimestampMillis()); this.createSink = new RisingwaveCreateSinkTemplate(bootstrapServer, location); diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveCommandType.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveCommandType.java index c0a0409270..1c16bea36e 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveCommandType.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveCommandType.java @@ -20,6 +20,7 @@ public enum RisingwaveCommandType { CREATE_TOPIC_COMMAND("CREATE TOPIC".getBytes()), CREATE_TABLE_COMMAND("CREATE TABLE".getBytes()), + CREATE_STREAM_COMMAND("CREATE STREAM".getBytes()), CREATE_MATERIALIZED_VIEW_COMMAND("CREATE MATERIALIZED VIEW".getBytes()), CREATE_FUNCTION_COMMAND("CREATE FUNCTION".getBytes()), UNKNOWN_COMMAND("UNKNOWN".getBytes()); diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCommandTemplate.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCommandTemplate.java index d97fb34c48..bb65d54a24 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCommandTemplate.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCommandTemplate.java @@ -15,6 +15,7 @@ package io.aklivity.zilla.runtime.binding.risingwave.internal.statement; import java.io.StringReader; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -28,11 +29,11 @@ public abstract class RisingwaveCommandTemplate { private final CCJSqlParserManager parserManager = new CCJSqlParserManager(); - private final Map includeMap = new Object2ObjectHashMap<>(); + private final Map includeMap = new LinkedHashMap<>(); + protected final StringBuilder fieldBuilder = new StringBuilder(); protected final StringBuilder includeBuilder = new StringBuilder(); protected static final Map ZILLA_MAPPINGS = new Object2ObjectHashMap<>(); - static { ZILLA_MAPPINGS.put("zilla_correlation_id", "INCLUDE header 'zilla:correlation-id' AS %s\n"); @@ -40,6 +41,14 @@ public abstract class RisingwaveCommandTemplate ZILLA_MAPPINGS.put("timestamp", "INCLUDE timestamp AS %s\n"); } + protected static final Map ZILLA_INCLUDE_TYPE_MAPPINGS = new Object2ObjectHashMap<>(); + static + { + ZILLA_INCLUDE_TYPE_MAPPINGS.put("zilla_correlation_id", "VARCHAR"); + ZILLA_INCLUDE_TYPE_MAPPINGS.put("zilla_identity", "VARCHAR"); + ZILLA_INCLUDE_TYPE_MAPPINGS.put("timestamp", "TIMESTAMP"); + } + public String primaryKey( CreateTable statement) { @@ -70,6 +79,7 @@ public RisingwaveCreateTableCommand parserCreateTable( int length) { String query = buffer.getStringWithoutLengthUtf8(offset, length); + query = query.replaceAll("(?i)\\bCREATE\\s+STREAM\\b", "CREATE TABLE"); int includeIndex = query.indexOf("INCLUDE"); diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateMaterializedViewTemplate.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateMaterializedViewTemplate.java index 17c227df3a..4a57891eb3 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateMaterializedViewTemplate.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateMaterializedViewTemplate.java @@ -14,25 +14,60 @@ */ package io.aklivity.zilla.runtime.binding.risingwave.internal.statement; -import net.sf.jsqlparser.statement.Statement; +import net.sf.jsqlparser.statement.create.table.CreateTable; import net.sf.jsqlparser.statement.create.view.CreateView; public class RisingwaveCreateMaterializedViewTemplate extends RisingwaveCommandTemplate { private final String sqlFormat = """ CREATE MATERIALIZED VIEW IF NOT EXISTS %s AS %s;\u0000"""; + private final String fieldFormat = "%s, "; + private final String includeFormat = "COALESCE(%s, zilla_%s_header::varchar) as %s, "; public RisingwaveCreateMaterializedViewTemplate() { } public String generate( - Statement statement) + CreateView createView) { - CreateView createView = (CreateView) statement; String view = createView.getView().getName(); String select = createView.getSelect().toString(); return String.format(sqlFormat, view, select); } + + public String generate( + RisingwaveCreateTableCommand command) + { + CreateTable createTable = command.createTable; + String name = createTable.getTable().getName(); + + String select = "*"; + + if (command.includes != null) + { + fieldBuilder.setLength(0); + + createTable.getColumnDefinitions() + .forEach(c -> fieldBuilder.append( + String.format(fieldFormat, c.getColumnName()))); + command.includes.forEach((k, v) -> + { + if ("timestamp".equals(k)) + { + fieldBuilder.append(String.format(fieldFormat, v)); + } + else + { + fieldBuilder.append(String.format(includeFormat, v, v, v)); + } + }); + + fieldBuilder.delete(fieldBuilder.length() - 2, fieldBuilder.length()); + select = fieldBuilder.toString(); + } + + return String.format(sqlFormat, "%s_view".formatted(name), "SELECT %s FROM %s_source".formatted(select, name)); + } } diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSinkTemplate.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSinkTemplate.java index d5133d2eaf..e30a55b5f3 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSinkTemplate.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSinkTemplate.java @@ -17,12 +17,14 @@ import java.util.Map; import java.util.Optional; -import net.sf.jsqlparser.statement.Statement; +import net.sf.jsqlparser.statement.create.table.CreateTable; import net.sf.jsqlparser.statement.create.view.CreateView; public class RisingwaveCreateSinkTemplate extends RisingwaveCommandTemplate { private final String sqlFormat = """ + CREATE SINK %s_view_sink INTO %s FROM %s_view;\u0000"""; + private final String sqlKafkaFormat = """ CREATE SINK %s_sink FROM %s WITH ( @@ -49,9 +51,8 @@ public RisingwaveCreateSinkTemplate( public String generate( String database, Map columns, - Statement statement) + CreateView createView) { - CreateView createView = (CreateView) statement; String viewName = createView.getView().getName(); Optional> primaryKeyMatch = columns.entrySet().stream() @@ -68,6 +69,25 @@ public String generate( String textPrimaryKey = primaryKeyMatch.map(Map.Entry::getKey).orElse(null); String primaryKey = textPrimaryKey != null ? primaryKeyFormat.formatted(textPrimaryKey) : ""; - return String.format(sqlFormat, viewName, viewName, bootstrapServer, database, viewName, primaryKey, schemaRegistry); + return String.format(sqlKafkaFormat, viewName, viewName, bootstrapServer, database, viewName, primaryKey, schemaRegistry); + } + + public String generate( + String database, + String primaryKey, + CreateTable createTable) + { + String table = createTable.getTable().getName(); + + return String.format(sqlKafkaFormat, table, table, bootstrapServer, database, table, + primaryKeyFormat.formatted(primaryKey), schemaRegistry); + } + + public String generate( + CreateTable createTable) + { + String table = createTable.getTable().getName(); + + return String.format(sqlFormat, table, table, table); } } diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSourceTemplate.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSourceTemplate.java index da095da905..1e64e8456d 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSourceTemplate.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateSourceTemplate.java @@ -44,7 +44,7 @@ public RisingwaveCreateSourceTemplate( this.scanStartupMil = scanStartupMil; } - public String generate( + public String generateStreamSource( String database, RisingwaveCreateTableCommand command) { @@ -61,4 +61,35 @@ public String generate( return String.format(sqlFormat, table, includeBuilder, bootstrapServer, database, table, scanStartupMil, schemaRegistry); } + + public String generateTableSource( + String database, + RisingwaveCreateTableCommand command) + { + String table = command.createTable.getTable().getName(); + String sourceName = "%s_source".formatted(table); + + includeBuilder.setLength(0); + final Map includes = command.includes; + if (includes != null && !includes.isEmpty()) + { + includeBuilder.append("\n"); + includes.forEach((k, v) -> + { + if ("timestamp".equals(k)) + { + includeBuilder.append(String.format(ZILLA_MAPPINGS.get(k), v)); + } + else + { + includeBuilder.append(String.format(ZILLA_MAPPINGS.get(k), "zilla_%s_header".formatted(v))); + } + + }); + includeBuilder.delete(includeBuilder.length() - 1, includeBuilder.length()); + } + + return String.format(sqlFormat, sourceName, includeBuilder, bootstrapServer, + database, table, scanStartupMil, schemaRegistry); + } } diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTableTemplate.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTableTemplate.java index ac4d8507dc..9e8f98acf0 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTableTemplate.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTableTemplate.java @@ -14,61 +14,41 @@ */ package io.aklivity.zilla.runtime.binding.risingwave.internal.statement; -import java.util.Map; - import net.sf.jsqlparser.statement.create.table.CreateTable; public class RisingwaveCreateTableTemplate extends RisingwaveCommandTemplate { private final String sqlFormat = """ - CREATE TABLE IF NOT EXISTS %s ( - *, - PRIMARY KEY (%s) - ) - INCLUDE KEY AS key%s - WITH ( - connector='kafka', - properties.bootstrap.server='%s', - topic='%s.%s', - scan.startup.mode='latest', - scan.startup.timestamp.millis='%d' - ) FORMAT PLAIN ENCODE AVRO ( - schema.registry = '%s' - );\u0000"""; - - private final String bootstrapServer; - private final String schemaRegistry; - private final long scanStartupMil; + CREATE TABLE IF NOT EXISTS %s (%s%s);\u0000"""; + private final String primaryKeyFormat = ", PRIMARY KEY (%s)"; + private final String fieldFormat = "%s %s, "; - public RisingwaveCreateTableTemplate( - String bootstrapServer, - String schemaRegistry, - long scanStartupMil) + public RisingwaveCreateTableTemplate() { - this.bootstrapServer = bootstrapServer; - this.schemaRegistry = schemaRegistry; - this.scanStartupMil = scanStartupMil; } public String generate( - String database, RisingwaveCreateTableCommand command) { CreateTable createTable = command.createTable; - String table = createTable.getTable().getName(); + String topic = createTable.getTable().getName(); + String primaryKeyField = primaryKey(createTable); + String primaryKey = primaryKeyField != null ? String.format(primaryKeyFormat, primaryKeyField) : ""; - String primaryKey = primaryKey(createTable); + fieldBuilder.setLength(0); - includeBuilder.setLength(0); - final Map includes = command.includes; - if (includes != null && !includes.isEmpty()) + createTable.getColumnDefinitions() + .forEach(c -> fieldBuilder.append( + String.format(fieldFormat, c.getColumnName(), c.getColDataType().getDataType()))); + + if (command.includes != null) { - includeBuilder.append("\n"); - includes.forEach((k, v) -> includeBuilder.append(String.format(ZILLA_MAPPINGS.get(k), v))); - includeBuilder.delete(includeBuilder.length() - 1, includeBuilder.length()); + command.includes.forEach((k, v) -> fieldBuilder.append( + String.format(fieldFormat, v, ZILLA_INCLUDE_TYPE_MAPPINGS.get(k)))); } - return String.format(sqlFormat, table, primaryKey, includeBuilder, bootstrapServer, database, - table, scanStartupMil, schemaRegistry); + fieldBuilder.delete(fieldBuilder.length() - 2, fieldBuilder.length()); + + return String.format(sqlFormat, topic, fieldBuilder, primaryKey); } } diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTopicTemplate.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTopicTemplate.java index 9e2c627c56..f088a3111a 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTopicTemplate.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateTopicTemplate.java @@ -45,6 +45,32 @@ public String generate( createTable.getColumnDefinitions() .forEach(c -> fieldBuilder.append( String.format(fieldFormat, c.getColumnName(), c.getColDataType().getDataType()))); + + fieldBuilder.delete(fieldBuilder.length() - 2, fieldBuilder.length()); + + return String.format(sqlFormat, topic, fieldBuilder, primaryKey); + } + + public String generate( + RisingwaveCreateTableCommand command) + { + CreateTable createTable = command.createTable; + String topic = createTable.getTable().getName(); + String primaryKeyField = primaryKey(createTable); + String primaryKey = primaryKeyField != null ? String.format(primaryKeyFormat, primaryKeyField) : ""; + + fieldBuilder.setLength(0); + + createTable.getColumnDefinitions() + .forEach(c -> fieldBuilder.append( + String.format(fieldFormat, c.getColumnName(), c.getColDataType().getDataType()))); + + if (command.includes != null) + { + command.includes.forEach((k, v) -> fieldBuilder.append( + String.format(fieldFormat, v, ZILLA_INCLUDE_TYPE_MAPPINGS.get(k)))); + } + fieldBuilder.delete(fieldBuilder.length() - 2, fieldBuilder.length()); return String.format(sqlFormat, topic, fieldBuilder, primaryKey); diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveSqlCommandParser.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveSqlCommandParser.java index 619a25ddfb..5fe8d3a60b 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveSqlCommandParser.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveSqlCommandParser.java @@ -27,7 +27,7 @@ public final class RisingwaveSqlCommandParser private static final String SQL_COMMAND_PATTERN = "(?i)\\b(CREATE FUNCTION)\\b.*?\\$\\$(.*?)\\$\\$\\s*;[\\x00\\n]*" + "|\\b(CREATE FUNCTION)\\b.*?RETURNS .*?AS.*?;[\\x00\\n]*" + - "|\\b(CREATE MATERIALIZED VIEW|CREATE SOURCE|CREATE SINK|CREATE INDEX" + + "|\\b(CREATE MATERIALIZED VIEW|CREATE SOURCE|CREATE SINK|CREATE INDEX|CREATE STREAM" + "|CREATE VIEW|SHOW TABLES|DESCRIBE|SHOW)\\b.*?;[\\x00\\n]*" + "|\\b(SELECT|INSERT|UPDATE|DELETE|ALTER|DROP|CREATE TABLE|CREATE SCHEMA|CREATE DATABASE)\\b.*?;[\\x00\\n]*"; diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveCompletionCommand.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveCompletionCommand.java index b80098e3e8..5c3204e749 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveCompletionCommand.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveCompletionCommand.java @@ -19,6 +19,7 @@ public enum RisingwaveCompletionCommand UNKNOWN_COMMAND("UNKNOWN".getBytes()), CREATE_TABLE_COMMAND("CREATE_TABLE".getBytes()), CREATE_MATERIALIZED_VIEW_COMMAND("CREATE_MATERIALIZED_VIEW".getBytes()), + CREATE_STREAM_COMMAND("CREATE_STREAM".getBytes()), CREATE_FUNCTION_COMMAND("CREATE_FUNCTION".getBytes()); private final byte[] value; diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveProxyFactory.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveProxyFactory.java index 418a848edd..a4e1a31aee 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveProxyFactory.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/RisingwaveProxyFactory.java @@ -144,6 +144,7 @@ public final class RisingwaveProxyFactory implements RisingwaveStreamFactory Object2ObjectHashMap clientTransforms = new Object2ObjectHashMap<>(); clientTransforms.put(RisingwaveCommandType.CREATE_TABLE_COMMAND, this::decodeCreateTableCommand); + clientTransforms.put(RisingwaveCommandType.CREATE_STREAM_COMMAND, this::decodeCreateStreamCommand); clientTransforms.put(RisingwaveCommandType.CREATE_MATERIALIZED_VIEW_COMMAND, this::decodeCreateMaterializedViewCommand); clientTransforms.put(RisingwaveCommandType.CREATE_FUNCTION_COMMAND, this::decodeCreateFunctionCommand); clientTransforms.put(RisingwaveCommandType.UNKNOWN_COMMAND, this::decodeUnknownCommand); @@ -1466,7 +1467,7 @@ private void decodeCreateTableCommand( int offset, int length) { - if (server.commandsProcessed == 2) + if (server.commandsProcessed == 6) { server.onCommandCompleted(traceId, authorization, length, RisingwaveCompletionCommand.CREATE_TABLE_COMMAND); } @@ -1481,15 +1482,68 @@ private void decodeCreateTableCommand( if (server.commandsProcessed == 0) { - newStatement = binding.createTopic.generate(command.createTable); + newStatement = binding.createTopic.generate(command); + } + else if (server.commandsProcessed == 1) + { + newStatement = binding.createSource.generateTableSource(server.database, command); + } + else if (server.commandsProcessed == 2) + { + newStatement = binding.createView.generate(command); + } + else if (server.commandsProcessed == 3) + { + newStatement = binding.createTable.generate(command); + } + else if (server.commandsProcessed == 4) + { + newStatement = binding.createSink.generate(command.createTable); + } + else if (server.commandsProcessed == 5) + { + newStatement = binding.createSink.generate(server.database, primaryKey, command.createTable); } - else if (server.commandsProcessed == 1 && primaryKey != null) + + statementBuffer.putBytes(progress, newStatement.getBytes()); + progress += newStatement.length(); + + final RisingwaveRouteConfig route = + server.binding.resolve(authorization, statementBuffer, 0, progress); + + final PgsqlClient client = server.streamsByRouteIds.get(route.id); + client.doPgsqlQuery(traceId, authorization, statementBuffer, 0, progress); + client.typeCommand = ignoreFlushCommand; + } + } + + private void decodeCreateStreamCommand( + PgsqlServer server, + long traceId, + long authorization, + DirectBuffer buffer, + int offset, + int length) + { + if (server.commandsProcessed == 2) + { + server.onCommandCompleted(traceId, authorization, length, RisingwaveCompletionCommand.CREATE_STREAM_COMMAND); + } + else + { + final RisingwaveBindingConfig binding = server.binding; + final RisingwaveCreateTableCommand command = binding.createTable.parserCreateTable(buffer, offset, length); + + String newStatement = ""; + int progress = 0; + + if (server.commandsProcessed == 0) { - newStatement = binding.createTable.generate(server.database, command); + newStatement = binding.createTopic.generate(command.createTable); } else if (server.commandsProcessed == 1) { - newStatement = binding.createSource.generate(server.database, command); + newStatement = binding.createSource.generateStreamSource(server.database, command); } statementBuffer.putBytes(progress, newStatement.getBytes()); diff --git a/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java b/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java index 316ab6d996..9eed51a8c0 100644 --- a/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java +++ b/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java @@ -62,9 +62,9 @@ public void shouldCreateTableWithPrimaryKey() throws Exception @Test @Configuration("proxy.yaml") @Specification({ - "${pgsql}/create.table/client", - "${effective}/create.table/server" }) - public void shouldCreateTable() throws Exception + "${pgsql}/create.stream/client", + "${effective}/create.stream/server" }) + public void shouldCreateStream() throws Exception { k3po.finish(); } @@ -72,9 +72,9 @@ public void shouldCreateTable() throws Exception @Test @Configuration("proxy.yaml") @Specification({ - "${pgsql}/create.tables/client", - "${effective}/create.tables/server" }) - public void shouldCreateTables() throws Exception + "${pgsql}/create.streams/client", + "${effective}/create.streams/server" }) + public void shouldCreateStreams() throws Exception { k3po.finish(); } @@ -144,9 +144,9 @@ public void shouldCreateFunctionEmbedded() throws Exception @Test @Configuration("proxy.yaml") @Specification({ - "${pgsql}/create.table.with.includes/client", - "${effective}/create.table.with.includes/server" }) - public void shouldCreateTableWithIncludes() throws Exception + "${pgsql}/create.stream.with.includes/client", + "${effective}/create.stream.with.includes/server" }) + public void shouldCreateStreamWithIncludes() throws Exception { k3po.finish(); } From 9499bef7a29e32d3ebdbdec6905bac68841d94a9 Mon Sep 17 00:00:00 2001 From: Akram Yakubov Date: Thu, 3 Oct 2024 18:26:33 -0700 Subject: [PATCH 3/6] Support jwt guarded identity via custom token claim (#1277) --- .../guard/jwt/config/JwtOptionsConfig.java | 3 + .../jwt/config/JwtOptionsConfigBuilder.java | 10 +++- .../guard/jwt/internal/JwtGuardHandler.java | 57 ++++++++++--------- .../config/JwtOptionsConfigAdapter.java | 11 ++++ .../jwt/internal/JwtGuardHandlerTest.java | 34 +++++++++++ .../guard/jwt/schema/jwt.schema.patch.json | 6 ++ 6 files changed, 92 insertions(+), 29 deletions(-) diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfig.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfig.java index 2ac7787f91..eb5ac5d879 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfig.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfig.java @@ -29,6 +29,7 @@ public class JwtOptionsConfig extends OptionsConfig public final String audience; public final List keys; public final Optional challenge; + public final String identity; public final Optional keysURL; public static JwtOptionsConfigBuilder builder() @@ -47,12 +48,14 @@ public static JwtOptionsConfigBuilder builder( String audience, List keys, Duration challenge, + String identity, String keysURL) { this.issuer = issuer; this.audience = audience; this.keys = keys; this.challenge = ofNullable(challenge); + this.identity = identity; this.keysURL = ofNullable(keysURL); } } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfigBuilder.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfigBuilder.java index 7ae6d40e22..eb3c437557 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfigBuilder.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/config/JwtOptionsConfigBuilder.java @@ -30,6 +30,7 @@ public class JwtOptionsConfigBuilder extends ConfigBuilder keys; private Duration challenge; + private String identity; private String keysURL; JwtOptionsConfigBuilder( @@ -66,6 +67,13 @@ public JwtOptionsConfigBuilder challenge( return this; } + public JwtOptionsConfigBuilder identity( + String identity) + { + this.identity = identity; + return this; + } + public JwtOptionsConfigBuilder keys( List keys) { @@ -99,6 +107,6 @@ public JwtOptionsConfigBuilder keysURL( @Override public T build() { - return mapper.apply(new JwtOptionsConfig(issuer, audience, keys, challenge, keysURL)); + return mapper.apply(new JwtOptionsConfig(issuer, audience, keys, challenge, identity, keysURL)); } } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java index be90da20c5..c9748c8ddd 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java @@ -58,6 +58,7 @@ public class JwtGuardHandler implements GuardHandler private final String issuer; private final String audience; private final Duration challenge; + private final String identity; private final Map keys; private final Long2ObjectHashMap sessionsById; private final LongSupplier supplyAuthorizedId; @@ -72,14 +73,14 @@ public JwtGuardHandler( this.issuer = options.issuer; this.audience = options.audience; this.challenge = options.challenge.orElse(null); + this.identity = options.identity; List keysConfig = options.keys; if ((keysConfig == null || keysConfig.isEmpty()) && options.keysURL.isPresent()) { - JsonbConfig config = new JsonbConfig() - .withAdapters(new JwtKeySetConfigAdapter()); Jsonb jsonb = JsonbBuilder.newBuilder() - .withConfig(config) + .withConfig(new JsonbConfig() + .withAdapters(new JwtKeySetConfigAdapter())) .build(); Path keysPath = context.resolvePath(options.keysURL.get()); String keysText = readKeys(keysPath); @@ -128,7 +129,7 @@ public long reauthorize( String credentials) { JwtSession session = null; - String subject = null; + String identity = null; String reason = ""; authorize: @@ -158,7 +159,7 @@ public long reauthorize( String payload = signature.getPayload(); JwtClaims claims = JwtClaims.parse(payload); - subject = claims.getSubject(); + identity = this.identity != null ? claims.getStringClaimValue(this.identity) : claims.getSubject(); NumericDate notBefore = claims.getNotBefore(); NumericDate notAfter = claims.getExpirationTime(); String issuer = claims.getIssuer(); @@ -185,7 +186,7 @@ public long reauthorize( .orElse(null); JwtSessionStore sessionStore = supplySessionStore(contextId); - session = sessionStore.supplySession(subject, roles); + session = sessionStore.supplySession(identity, roles); session.credentials = credentials; session.roles = roles; @@ -204,7 +205,7 @@ public long reauthorize( } if (session == null) { - event.authorizationFailed(traceId, bindingId, subject, reason); + event.authorizationFailed(traceId, bindingId, identity, reason); } return session != null ? session.authorized : NOT_AUTHORIZED; } @@ -231,7 +232,7 @@ public String identity( long sessionId) { JwtSession session = sessionsById.get(sessionId); - return session != null ? session.subject : null; + return session != null ? session.identity : null; } @Override @@ -298,51 +299,51 @@ private JwtSessionStore supplySessionStore( private final class JwtSessionStore { private final long contextId; - private final Map sessionsBySubject; + private final Map sessionsByIdentity; private JwtSessionStore( long contextId) { this.contextId = contextId; - this.sessionsBySubject = new IdentityHashMap<>(); + this.sessionsByIdentity = new IdentityHashMap<>(); } private JwtSession supplySession( - String subject, + String identity, List roles) { - String subjectKey = subject != null ? subject.intern() : null; - JwtSession session = sessionsBySubject.get(subjectKey); + String identityKey = identity != null ? identity.intern() : null; + JwtSession session = sessionsByIdentity.get(identityKey); - if (subjectKey == null || session != null && roles != null && !supersetOf(session, roles)) + if (identityKey == null || session != null && roles != null && !supersetOf(session, roles)) { - session = newSession(subjectKey); + session = newSession(identityKey); } else { - session = sessionsBySubject.computeIfAbsent(subjectKey, this::newSharedSession); + session = sessionsByIdentity.computeIfAbsent(identityKey, this::newSharedSession); } return session; } private JwtSession newSharedSession( - String subject) + String identity) { - return new JwtSession(supplyAuthorizedId.getAsLong(), subject, this::onUnshared); + return new JwtSession(supplyAuthorizedId.getAsLong(), identity, this::onUnshared); } private JwtSession newSession( - String subject) + String identity) { - return new JwtSession(supplyAuthorizedId.getAsLong(), subject); + return new JwtSession(supplyAuthorizedId.getAsLong(), identity); } private void onUnshared( JwtSession session) { - sessionsBySubject.remove(session.subject); - if (sessionsBySubject.isEmpty()) + sessionsByIdentity.remove(session.identity); + if (sessionsByIdentity.isEmpty()) { sessionStoresByContextId.remove(contextId); } @@ -352,7 +353,7 @@ private void onUnshared( private final class JwtSession { private final long authorized; - private final String subject; + private final String identity; private final Consumer unshare; private String credentials; @@ -366,18 +367,18 @@ private final class JwtSession private JwtSession( long authorized, - String subject) + String identity) { - this(authorized, subject, null); + this(authorized, identity, null); } private JwtSession( long authorized, - String subject, + String identity, Consumer unshare) { this.authorized = authorized; - this.subject = subject; + this.identity = identity; this.unshare = unshare; } @@ -385,7 +386,7 @@ boolean challenge( long now) { final boolean challenge = - subject != null && + identity != null && challengeAt <= now && now < expiresAt && challengedAt < challengeAt; diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtOptionsConfigAdapter.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtOptionsConfigAdapter.java index 8c6330c1b3..bab73ac590 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtOptionsConfigAdapter.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/config/JwtOptionsConfigAdapter.java @@ -40,6 +40,7 @@ public final class JwtOptionsConfigAdapter implements OptionsConfigAdapterSpi, J private static final String AUDIENCE_NAME = "audience"; private static final String KEYS_NAME = "keys"; private static final String CHALLENGE_NAME = "challenge"; + private static final String IDENTITY_NAME = "identity"; private static final List KEYS_DEFAULT = emptyList(); @@ -92,6 +93,11 @@ public JsonObject adaptToJson( object.add(CHALLENGE_NAME, jwtOptions.challenge.get().getSeconds()); } + if (jwtOptions.identity != null) + { + object.add(IDENTITY_NAME, jwtOptions.identity); + } + return object.build(); } @@ -149,6 +155,11 @@ public OptionsConfig adaptFromJson( jwtOptions.challenge(Duration.ofSeconds(object.getInt(CHALLENGE_NAME))); } + if (object.containsKey(IDENTITY_NAME)) + { + jwtOptions.identity(object.getString(IDENTITY_NAME)); + } + return jwtOptions.build(); } } diff --git a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java index a19d95da95..6df44ab5f1 100644 --- a/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java +++ b/runtime/guard-jwt/src/test/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandlerTest.java @@ -88,6 +88,40 @@ public void shouldAuthorize() throws Exception assertTrue(guard.verify(sessionId, asList("read:stream", "write:stream"))); } + @Test + public void shouldAuthorizeWithCustomIdentity() throws Exception + { + Duration challenge = ofSeconds(3L); + JwtOptionsConfig options = JwtOptionsConfig.builder() + .inject(identity()) + .issuer("test issuer") + .audience("testAudience") + .key(RFC7515_RS256_CONFIG) + .challenge(challenge) + .identity("username") + .build(); + JwtGuardHandler guard = new JwtGuardHandler(options, context, new MutableLong(1L)::getAndIncrement); + + Instant now = Instant.now(); + + JwtClaims claims = new JwtClaims(); + claims.setClaim("iss", "test issuer"); + claims.setClaim("aud", "testAudience"); + claims.setClaim("username", "johndoe"); + claims.setClaim("exp", now.getEpochSecond() + 10L); + claims.setClaim("scope", "read:stream write:stream"); + + String token = sign(claims.toJson(), "test", RFC7515_RS256, "RS256"); + + long sessionId = guard.reauthorize(0L, 0L, 101L, token); + + assertThat(sessionId, not(equalTo(0L))); + assertThat(guard.identity(sessionId), equalTo("johndoe")); + assertThat(guard.expiresAt(sessionId), equalTo(ofSeconds(now.getEpochSecond() + 10L).toMillis())); + assertThat(guard.expiringAt(sessionId), equalTo(ofSeconds(now.getEpochSecond() + 10L).minus(challenge).toMillis())); + assertTrue(guard.verify(sessionId, asList("read:stream", "write:stream"))); + } + @Test public void shouldChallengeDuringChallengeWindow() throws Exception { diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/schema/jwt.schema.patch.json b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/schema/jwt.schema.patch.json index 05aa10de29..e88157673e 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/schema/jwt.schema.patch.json +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/schema/jwt.schema.patch.json @@ -83,6 +83,12 @@ { "title": "Challenge", "type": "integer" + }, + "identity": + { + "title": "Identity", + "type": "string", + "default": "sub" } }, "additionalProperties": false From 22388554101ce8e2b9da85c9c051f6eaf7a27cd7 Mon Sep 17 00:00:00 2001 From: Akram Yakubov Date: Fri, 4 Oct 2024 17:28:42 -0700 Subject: [PATCH 4/6] `pgsql` DROP TOPIC command to KafkaDeleteTopicsBeginEx plus catalog unregister subject (#1280) --- .../stream/PgsqlKafkaCommandType.java | 1 + .../stream/PgsqlKafkaCompletionCommand.java | 1 + .../stream/PgsqlKafkaProxyFactory.java | 119 +++++++++++++++++- .../pgsql/kafka/internal/stream/ProxyIT.java | 11 ++ .../handler/SchemaRegistryCatalogHandler.java | 58 +++++++-- .../serializer/UnregisterSchemaRequest.java | 46 +++++++ .../registry/internal/SchemaRegistryIT.java | 11 ++ .../engine/catalog/CatalogHandler.java | 6 + .../internal/binding/TestBindingFactory.java | 6 +- .../registry/config/unregister/zilla.yaml | 31 +++++ .../registry/streams/unregister.schema.rpt | 33 +++++ 11 files changed, 312 insertions(+), 11 deletions(-) create mode 100644 runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/serializer/UnregisterSchemaRequest.java create mode 100644 specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/config/unregister/zilla.yaml create mode 100644 specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/streams/unregister.schema.rpt diff --git a/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCommandType.java b/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCommandType.java index 60ca9fd8b7..e7f4f22c7e 100644 --- a/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCommandType.java +++ b/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCommandType.java @@ -22,6 +22,7 @@ public enum PgsqlKafkaCommandType { CREATE_TOPIC_COMMAND("CREATE TOPIC".getBytes()), + DROP_TOPIC_COMMAND("DROP TOPIC".getBytes()), UNKNOWN_COMMAND("UNKNOWN".getBytes()); private final byte[] value; diff --git a/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCompletionCommand.java b/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCompletionCommand.java index c1d7352a22..085b7ea29a 100644 --- a/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCompletionCommand.java +++ b/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaCompletionCommand.java @@ -17,6 +17,7 @@ public enum PgsqlKafkaCompletionCommand { CREATE_TOPIC_COMMAND("CREATE_TOPIC".getBytes()), + DROP_TOPIC_COMMAND("DROP_TOPIC".getBytes()), UNKNOWN_COMMAND("UNKNOWN".getBytes()); private final byte[] value; diff --git a/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaProxyFactory.java b/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaProxyFactory.java index d7ca9e8180..6461b89336 100644 --- a/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaProxyFactory.java +++ b/incubator/binding-pgsql-kafka/src/main/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/PgsqlKafkaProxyFactory.java @@ -16,6 +16,7 @@ import static io.aklivity.zilla.runtime.engine.buffer.BufferPool.NO_SLOT; import static io.aklivity.zilla.runtime.engine.catalog.CatalogHandler.NO_VERSION_ID; +import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Objects.requireNonNull; import java.io.InputStreamReader; @@ -64,6 +65,7 @@ import net.sf.jsqlparser.parser.CCJSqlParserManager; import net.sf.jsqlparser.statement.Statement; import net.sf.jsqlparser.statement.create.table.CreateTable; +import net.sf.jsqlparser.statement.drop.Drop; public final class PgsqlKafkaProxyFactory implements PgsqlKafkaStreamFactory { @@ -143,6 +145,7 @@ public final class PgsqlKafkaProxyFactory implements PgsqlKafkaStreamFactory Object2ObjectHashMap pgsqlDecoder = new Object2ObjectHashMap<>(); pgsqlDecoder.put(PgsqlKafkaCommandType.CREATE_TOPIC_COMMAND, this::decodeCreateTopicCommand); + pgsqlDecoder.put(PgsqlKafkaCommandType.DROP_TOPIC_COMMAND, this::decodeDropTopicCommand); pgsqlDecoder.put(PgsqlKafkaCommandType.UNKNOWN_COMMAND, this::decodeUnknownCommand); this.pgsqlDecoder = pgsqlDecoder; } @@ -232,6 +235,7 @@ private final class PgsqlProxy private final String database; private final PgsqlKafkaBindingConfig binding; private final KafkaCreateTopicsProxy createTopicsProxy; + private final KafkaDeleteTopicsProxy deleteTopicsProxy; private final IntArrayQueue queries; @@ -281,6 +285,7 @@ private PgsqlProxy( this.queries = new IntArrayQueue(); this.createTopicsProxy = new KafkaCreateTopicsProxy(routedId, resolvedId, this); + this.deleteTopicsProxy = new KafkaDeleteTopicsProxy(routedId, resolvedId, this); } private void onAppMessage( @@ -488,7 +493,7 @@ private void onCommandCompleted( doAppWindow(traceId, authorization); } - public void onKafkaCreateTopicsBegin( + public void onKafkaBegin( long traceId, long authorization) { @@ -1018,7 +1023,81 @@ protected void onKafkaBegin( if (!errorExits) { - delegate.onKafkaCreateTopicsBegin(traceId, authorization); + delegate.onKafkaBegin(traceId, authorization); + + doKafkaWindow(traceId, authorization); + doKafkaEnd(traceId, authorization); + } + else + { + delegate.cleanup(traceId, authorization); + } + } + } + + private final class KafkaDeleteTopicsProxy extends KafkaProxy + { + private KafkaDeleteTopicsProxy( + long originId, + long routedId, + PgsqlProxy delegate) + { + super(originId, routedId, delegate); + } + + private void doKafkaBegin( + long traceId, + long authorization, + List topics) + { + initialSeq = delegate.initialSeq; + initialAck = delegate.initialAck; + initialMax = delegate.initialMax; + state = PgsqlKafkaState.openingInitial(state); + + final KafkaBeginExFW kafkaBeginEx = + kafkaBeginExRW.wrap(extBuffer, 0, extBuffer.capacity()) + .typeId(kafkaTypeId) + .request(r -> r + .deleteTopics(c -> c + .names(ct -> + topics.forEach(t -> ct.item(i -> i.set(t, UTF_8)))) + .timeout(config.kafkaTopicRequestTimeoutMs()))) + .build(); + + kafka = newKafkaConsumer(this::onKafkaMessage, originId, routedId, initialId, initialSeq, initialAck, initialMax, + traceId, authorization, 0, kafkaBeginEx); + } + + @Override + protected void onKafkaBegin( + BeginFW begin) + { + final long sequence = begin.sequence(); + final long acknowledge = begin.acknowledge(); + final long traceId = begin.traceId(); + final long authorization = begin.authorization(); + final OctetsFW extension = begin.extension(); + + assert acknowledge <= sequence; + assert sequence >= replySeq; + assert acknowledge >= replyAck; + + replySeq = sequence; + replyAck = acknowledge; + state = PgsqlKafkaState.openingReply(state); + + assert replyAck <= replySeq; + + final ExtensionFW beginEx = extension.get(extensionRO::tryWrap); + final KafkaBeginExFW kafkaBeginEx = + beginEx != null && beginEx.typeId() == kafkaTypeId ? extension.get(kafkaBeginExRO::tryWrap) : null; + + boolean errorExits = kafkaBeginEx.response().deleteTopics().topics().anyMatch(t -> t.error() != 0); + + if (!errorExits) + { + delegate.onKafkaBegin(traceId, authorization); doKafkaWindow(traceId, authorization); doKafkaEnd(traceId, authorization); @@ -1292,6 +1371,35 @@ else if (server.commandsProcessed == 0) } } + private void decodeDropTopicCommand( + PgsqlProxy server, + long traceId, + long authorization, + DirectBuffer buffer, + int offset, + int length) + { + if (server.commandsProcessed == 1) + { + server.onCommandCompleted(traceId, authorization, length, PgsqlKafkaCompletionCommand.DROP_TOPIC_COMMAND); + } + else if (server.commandsProcessed == 0) + { + final Drop drop = (Drop) parseStatement(buffer, offset, length); + final String topic = drop.getName().getName(); + + final PgsqlKafkaBindingConfig binding = server.binding; + final String subjectKey = String.format("%s.%s-key", server.database, topic); + final String subjectValue = String.format("%s.%s-value", server.database, topic); + + binding.catalog.unregister(subjectKey); + binding.catalog.unregister(subjectValue); + + final KafkaDeleteTopicsProxy deleteTopicsProxy = server.deleteTopicsProxy; + deleteTopicsProxy.doKafkaBegin(traceId, authorization, List.of("%s.%s".formatted(server.database, topic))); + } + } + private void decodeUnknownCommand( PgsqlProxy server, long traceId, @@ -1351,6 +1459,13 @@ private Statement parseStatement( sql = sql.replace("CREATE TOPIC", "CREATE TABLE"); statement = parserManager.parse(new StringReader(sql)); } + if (decodeCommandType(buffer, offset, length). + equals(PgsqlKafkaCommandType.DROP_TOPIC_COMMAND)) + { + String sql = buffer.getStringWithoutLengthUtf8(offset, length); + sql = sql.replace("DROP TOPIC", "DROP TABLE"); + statement = parserManager.parse(new StringReader(sql)); + } else { inputStream.wrap(buffer, offset, length); diff --git a/incubator/binding-pgsql-kafka/src/test/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/ProxyIT.java b/incubator/binding-pgsql-kafka/src/test/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/ProxyIT.java index 58d08cba16..ea24574a15 100644 --- a/incubator/binding-pgsql-kafka/src/test/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/ProxyIT.java +++ b/incubator/binding-pgsql-kafka/src/test/java/io/aklivity/zilla/runtime/binding/pgsql/kafka/internal/stream/ProxyIT.java @@ -58,4 +58,15 @@ public void shouldCreateTopic() throws Exception { k3po.finish(); } + + @Test + @Configuration("proxy.yaml") + @Specification({ + "${pgsql}/drop.topic/client", + "${kafka}/drop.topic/server" + }) + public void shouldDropTopic() throws Exception + { + k3po.finish(); + } } diff --git a/runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/handler/SchemaRegistryCatalogHandler.java b/runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/handler/SchemaRegistryCatalogHandler.java index 10de4803db..587c991d91 100644 --- a/runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/handler/SchemaRegistryCatalogHandler.java +++ b/runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/handler/SchemaRegistryCatalogHandler.java @@ -15,6 +15,7 @@ package io.aklivity.zilla.runtime.catalog.schema.registry.internal.handler; import static io.aklivity.zilla.runtime.catalog.schema.registry.internal.handler.CachedSchemaId.IN_PROGRESS; +import static io.aklivity.zilla.runtime.catalog.schema.registry.internal.serializer.UnregisterSchemaRequest.NO_VERSIONS; import java.net.URI; import java.net.http.HttpClient; @@ -35,6 +36,7 @@ import io.aklivity.zilla.runtime.catalog.schema.registry.internal.config.SchemaRegistryCatalogConfig; import io.aklivity.zilla.runtime.catalog.schema.registry.internal.events.SchemaRegistryEventContext; import io.aklivity.zilla.runtime.catalog.schema.registry.internal.serializer.RegisterSchemaRequest; +import io.aklivity.zilla.runtime.catalog.schema.registry.internal.serializer.UnregisterSchemaRequest; import io.aklivity.zilla.runtime.catalog.schema.registry.internal.types.SchemaRegistryPrefixFW; import io.aklivity.zilla.runtime.engine.catalog.CatalogHandler; import io.aklivity.zilla.runtime.engine.model.function.ValueConsumer; @@ -42,7 +44,8 @@ public class SchemaRegistryCatalogHandler implements CatalogHandler { private static final String SUBJECT_VERSION_PATH = "/subjects/{0}/versions/{1}"; - private static final String SUBJECT_PATH = "/subjects/{0}/versions"; + private static final String REGISTER_SUBJECT_PATH = "/subjects/{0}/versions"; + private static final String UNREGISTER_SUBJECT_PATH = "/subjects/{0}"; private static final String SCHEMA_PATH = "/schemas/ids/{0}"; private static final int MAX_PADDING_LENGTH = 5; @@ -55,7 +58,8 @@ public class SchemaRegistryCatalogHandler implements CatalogHandler private final HttpClient client; private final String baseUrl; - private final RegisterSchemaRequest request; + private final RegisterSchemaRequest registerRequest; + private final UnregisterSchemaRequest unregisterRequest; private final CRC32C crc32c; private final Int2ObjectCache schemas; private final Int2ObjectCache schemaIds; @@ -70,7 +74,8 @@ public SchemaRegistryCatalogHandler( { this.baseUrl = catalog.options.url; this.client = HttpClient.newHttpClient(); - this.request = new RegisterSchemaRequest(); + this.registerRequest = new RegisterSchemaRequest(); + this.unregisterRequest = new UnregisterSchemaRequest(); this.crc32c = new CRC32C(); this.schemas = new Int2ObjectCache<>(1, 1024, i -> {}); this.schemaIds = new Int2ObjectCache<>(1, 1024, i -> {}); @@ -88,15 +93,30 @@ public int register( { int versionId = NO_VERSION_ID; - String response = sendPostHttpRequest(MessageFormat.format(SUBJECT_PATH, subject), schema); + String response = sendPostHttpRequest(MessageFormat.format(REGISTER_SUBJECT_PATH, subject), schema); if (response != null) { - versionId = request.resolveResponse(response); + versionId = registerRequest.resolveResponse(response); } return versionId; } + @Override + public int[] unregister( + String subject) + { + int[] versions = NO_VERSIONS; + + String response = sendDeleteHttpRequest(MessageFormat.format(UNREGISTER_SUBJECT_PATH, subject)); + if (response != null) + { + versions = unregisterRequest.resolveResponse(response); + } + + return versions; + } + @Override public String resolve( int schemaId) @@ -149,7 +169,7 @@ public String resolve( { event.onRetrievableSchemaId(catalogId, schemaId); } - newFuture.complete(new CachedSchema(request.resolveSchemaResponse(response), retryAttempts)); + newFuture.complete(new CachedSchema(registerRequest.resolveSchemaResponse(response), retryAttempts)); } } catch (Throwable ex) @@ -251,8 +271,8 @@ else if (response != null) { event.onRetrievableSchemaSubjectVersion(catalogId, subject, version); } - newFuture.complete(new CachedSchemaId(System.currentTimeMillis(), request.resolveResponse(response), - retryAttempts, retryAfter)); + newFuture.complete(new CachedSchemaId(System.currentTimeMillis(), + registerRequest.resolveResponse(response), retryAttempts, retryAfter)); } } catch (Throwable ex) @@ -390,6 +410,28 @@ private String sendPostHttpRequest( return responseBody; } + private String sendDeleteHttpRequest( + String path) + { + HttpRequest httpRequest = HttpRequest + .newBuilder(toURI(baseUrl, path)) + .version(HttpClient.Version.HTTP_1_1) + .DELETE() + .build(); + + String responseBody; + try + { + HttpResponse httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString()); + responseBody = httpResponse.statusCode() == 200 ? httpResponse.body() : null; + } + catch (Exception ex) + { + responseBody = null; + } + return responseBody; + } + @Override public String location() { diff --git a/runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/serializer/UnregisterSchemaRequest.java b/runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/serializer/UnregisterSchemaRequest.java new file mode 100644 index 0000000000..84ff7d4361 --- /dev/null +++ b/runtime/catalog-schema-registry/src/main/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/serializer/UnregisterSchemaRequest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2021-2023 Aklivity Inc + * + * Licensed under the Aklivity Community License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of the + * License at + * + * https://www.aklivity.io/aklivity-community-license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.aklivity.zilla.runtime.catalog.schema.registry.internal.serializer; + +import java.io.StringReader; +import java.util.stream.IntStream; + +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonReader; +import jakarta.json.stream.JsonParsingException; + +public class UnregisterSchemaRequest +{ + public static final int[] NO_VERSIONS = new int[0]; + + public int[] resolveResponse( + String response) + { + try + { + JsonReader reader = Json.createReader(new StringReader(response)); + JsonArray array = reader.readArray(); + + return IntStream.range(0, array.size()) + .map(array::getInt) + .toArray(); + } + catch (JsonParsingException ex) + { + return NO_VERSIONS; + } + } +} diff --git a/runtime/catalog-schema-registry/src/test/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/SchemaRegistryIT.java b/runtime/catalog-schema-registry/src/test/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/SchemaRegistryIT.java index d22a449690..704c6f25ad 100644 --- a/runtime/catalog-schema-registry/src/test/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/SchemaRegistryIT.java +++ b/runtime/catalog-schema-registry/src/test/java/io/aklivity/zilla/runtime/catalog/schema/registry/internal/SchemaRegistryIT.java @@ -145,4 +145,15 @@ public void shouldRegisterSchema() throws Exception { k3po.finish(); } + + @Test + @Configuration("unregister/zilla.yaml") + @Specification({ + "${net}/handshake/client", + "${app}/handshake/server", + "${remote}/unregister.schema" }) + public void shouldUnregisterSchema() throws Exception + { + k3po.finish(); + } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java index 65b3aac632..ceabb8fdcf 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/catalog/CatalogHandler.java @@ -69,6 +69,12 @@ default int register( return NO_VERSION_ID; } + default int[] unregister( + String subject) + { + return new int[0]; + } + String resolve( int schemaId); diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java index e7e5a3e590..115764015e 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java @@ -343,11 +343,15 @@ else if (assertion.schema != null && !assertion.schema.equals(schema)) } else { + if (catalog.subject != null && schema == null) + { + handler.unregister(catalog.subject); + } if (catalog.subject != null && schema != null) { handler.register(catalog.subject, schema); } - else if (catalog.subject != null && catalog.version != null) + else if (catalog.subject != null && catalog.version != null && schema != null) { handler.resolve(catalog.subject, catalog.version); } diff --git a/specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/config/unregister/zilla.yaml b/specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/config/unregister/zilla.yaml new file mode 100644 index 0000000000..aac3817758 --- /dev/null +++ b/specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/config/unregister/zilla.yaml @@ -0,0 +1,31 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +--- +name: test +catalogs: + catalog0: + type: schema-registry + options: + url: http://localhost:8081 +bindings: + net0: + type: test + kind: server + options: + catalog: + catalog0: + - subject: items-snapshots-value + exit: app0 diff --git a/specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/streams/unregister.schema.rpt b/specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/streams/unregister.schema.rpt new file mode 100644 index 0000000000..98873d56dd --- /dev/null +++ b/specs/catalog-schema-registry.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/schema/registry/streams/unregister.schema.rpt @@ -0,0 +1,33 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "http://localhost:8081/subjects/items-snapshots-value" + +accepted +connected + +read http:method "DELETE" +read http:version "HTTP/1.1" +read http:header "Host" "localhost:8081" + +read closed + +write http:status "200" "OK" +write http:header "content-type" "application/vnd.schemaregistry.v1+json" +write http:content-length + +write '[1]' + +write close From dbd8cdb2ea00b20ba355b3052b3f22d2ef3ca1ee Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Mon, 7 Oct 2024 21:46:42 +0530 Subject: [PATCH 5/6] external udf - python support (#1278) --- .../risingwave/config/proxy.function.yaml | 2 + .../schema/risingwave.schema.patch.json | 9 ++- .../client.rpt | 58 ++++++++++++++ .../server.rpt | 58 ++++++++++++++ .../create.function.python/client.rpt | 57 ++++++++++++++ .../create.function.python/server.rpt | 57 ++++++++++++++ .../create.function.return.struct/client.rpt | 57 ++++++++++++++ .../create.function.return.struct/server.rpt | 57 ++++++++++++++ .../create.function.return.table/client.rpt | 2 +- .../create.function.return.table/server.rpt | 2 +- .../client.rpt | 57 ++++++++++++++ .../server.rpt | 59 +++++++++++++++ .../pgsql/create.function.python/client.rpt | 54 +++++++++++++ .../pgsql/create.function.python/server.rpt | 55 ++++++++++++++ .../create.function.return.struct/client.rpt | 54 +++++++++++++ .../create.function.return.struct/server.rpt | 55 ++++++++++++++ .../risingwave/streams/EffectiveIT.java | 29 +++++++ .../binding/risingwave/streams/PgsqlIT.java | 29 +++++++ .../config/RisingwaveBindingConfig.java | 7 +- .../RisingwaveCreateFunctionTemplate.java | 75 ++++++++++++------- .../risingwave/internal/stream/ProxyIT.java | 30 ++++++++ 21 files changed, 827 insertions(+), 36 deletions(-) create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/client.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/server.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/client.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/server.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/client.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/server.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/client.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/server.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/client.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/server.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/client.rpt create mode 100644 incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/server.rpt diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/config/proxy.function.yaml b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/config/proxy.function.yaml index 4eb1dc5d79..1abafe32f1 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/config/proxy.function.yaml +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/config/proxy.function.yaml @@ -22,4 +22,6 @@ bindings: options: udf: - server: http://localhost:8815 + - server: http://localhost:8816 + language: python exit: app1 diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/schema/risingwave.schema.patch.json b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/schema/risingwave.schema.patch.json index 1a58ec38b4..3b01fea130 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/schema/risingwave.schema.patch.json +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/schema/risingwave.schema.patch.json @@ -80,13 +80,16 @@ "title": "Language", "type": "string", "default": "java", - "const": "java" + "enum": + [ + "java", + "python" + ] } }, "additionalProperties": false }, - "minItems": 1, - "maxItems": 1 + "minItems": 1 } }, "additionalProperties": false diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/client.rpt new file mode 100644 index 0000000000..2c278d588e --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/client.rpt @@ -0,0 +1,58 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/app1" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE FUNCTION gcd(a int, b int) RETURNS int LANGUAGE python AS $$\n" + "def gcd(a, b):\n" + " while b != 0:\n" + " a, b = b, a % b\n" + " return a\n" + "$$;" + [0x00] + +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/server.rpt new file mode 100644 index 0000000000..9d99f91c94 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.embedded.python/server.rpt @@ -0,0 +1,58 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "zilla://streams/app1" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE FUNCTION gcd(a int, b int) RETURNS int LANGUAGE python AS $$\n" + "def gcd(a, b):\n" + " while b != 0:\n" + " a, b = b, a % b\n" + " return a\n" + "$$;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/client.rpt new file mode 100644 index 0000000000..33ee75c8cb --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/client.rpt @@ -0,0 +1,57 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/app1" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE FUNCTION gcd(int , int)\n" + "RETURNS int\n" + "AS gcd\n" + "LANGUAGE python\n" + "USING LINK 'http://localhost:8816';" + [0x00] + +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/server.rpt new file mode 100644 index 0000000000..7bda0b7335 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.python/server.rpt @@ -0,0 +1,57 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "zilla://streams/app1" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE FUNCTION gcd(int , int)\n" + "RETURNS int\n" + "AS gcd\n" + "LANGUAGE python\n" + "USING LINK 'http://localhost:8816';" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/client.rpt new file mode 100644 index 0000000000..6c81524818 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/client.rpt @@ -0,0 +1,57 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/app1" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE FUNCTION key_value(bytea)\n" + "RETURNS struct < key varchar , value varchar >\n" + "AS key_value\n" + "LANGUAGE python\n" + "USING LINK 'http://localhost:8816';" + [0x00] + +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/server.rpt new file mode 100644 index 0000000000..23335bb651 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.struct/server.rpt @@ -0,0 +1,57 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +accept "zilla://streams/app1" + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE FUNCTION key_value(bytea)\n" + "RETURNS struct < key varchar , value varchar >\n" + "AS key_value\n" + "LANGUAGE python\n" + "USING LINK 'http://localhost:8816';" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/client.rpt index e07f659466..ebcab805e4 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/client.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/client.rpt @@ -33,7 +33,7 @@ write zilla:data.ext ${pgsql:dataEx() .build() .build()} write "CREATE FUNCTION series(int)\n" - "RETURNS TABLE (x int)\n" + "RETURNS TABLE ( x int )\n" "AS series\n" "LANGUAGE java\n" "USING LINK 'http://localhost:8815';" diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/server.rpt index 885d785192..ec7a49322a 100644 --- a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/server.rpt +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/effective/create.function.return.table/server.rpt @@ -35,7 +35,7 @@ read zilla:data.ext ${pgsql:dataEx() .build() .build()} read "CREATE FUNCTION series(int)\n" - "RETURNS TABLE (x int)\n" + "RETURNS TABLE ( x int )\n" "AS series\n" "LANGUAGE java\n" "USING LINK 'http://localhost:8815';" diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/client.rpt new file mode 100644 index 0000000000..2d2c2095f1 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/client.rpt @@ -0,0 +1,57 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE FUNCTION gcd(a int, b int) RETURNS int LANGUAGE python AS $$\n" + "def gcd(a, b):\n" + " while b != 0:\n" + " a, b = b, a % b\n" + " return a\n" + "$$;" + [0x00] +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/server.rpt new file mode 100644 index 0000000000..4db9600a78 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.embedded.python/server.rpt @@ -0,0 +1,59 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +property serverAddress "zilla://streams/app0" + +accept ${serverAddress} + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE FUNCTION gcd(a int, b int) RETURNS int LANGUAGE python AS $$\n" + "def gcd(a, b):\n" + " while b != 0:\n" + " a, b = b, a % b\n" + " return a\n" + "$$;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/client.rpt new file mode 100644 index 0000000000..340e999227 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/client.rpt @@ -0,0 +1,54 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE FUNCTION gcd(int, int) RETURNS int " + "LANGUAGE python AS gcd;" + [0x00] + +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/server.rpt new file mode 100644 index 0000000000..20e83d8382 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.python/server.rpt @@ -0,0 +1,55 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +property serverAddress "zilla://streams/app0" + +accept ${serverAddress} + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE FUNCTION gcd(int, int) RETURNS int " + "LANGUAGE python AS gcd;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/client.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/client.rpt new file mode 100644 index 0000000000..bf1030e822 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/client.rpt @@ -0,0 +1,54 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +connect "zilla://streams/app0" + option zilla:window 8192 + option zilla:transmission "duplex" + +write zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +write zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +write "CREATE FUNCTION key_value(bytea) RETURNS struct " + "LANGUAGE python AS key_value;" + [0x00] + +write flush + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +read advised zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} + diff --git a/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/server.rpt b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/server.rpt new file mode 100644 index 0000000000..05a9d55584 --- /dev/null +++ b/incubator/binding-risingwave.spec/src/main/scripts/io/aklivity/zilla/specs/binding/risingwave/streams/pgsql/create.function.return.struct/server.rpt @@ -0,0 +1,55 @@ +# +# Copyright 2021-2023 Aklivity Inc +# +# Licensed under the Aklivity Community License (the "License"); you may not use +# this file except in compliance with the License. You may obtain a copy of the +# License at +# +# https://www.aklivity.io/aklivity-community-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +property serverAddress "zilla://streams/app0" + +accept ${serverAddress} + option zilla:window 8192 + option zilla:transmission "duplex" + +accepted + +read zilla:begin.ext ${pgsql:beginEx() + .typeId(zilla:id("pgsql")) + .parameter("user", "root") + .parameter("database", "dev") + .parameter("application_name", "psql") + .parameter("client_encoding", "UTF8") + .build()} + +connected + +read zilla:data.ext ${pgsql:dataEx() + .typeId(zilla:id("pgsql")) + .query() + .build() + .build()} +read "CREATE FUNCTION key_value(bytea) RETURNS struct " + "LANGUAGE python AS key_value;" + [0x00] + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .completion() + .tag("CREATE_FUNCTION") + .build() + .build()} + +write advise zilla:flush ${pgsql:flushEx() + .typeId(zilla:id("pgsql")) + .ready() + .status("IDLE") + .build() + .build()} diff --git a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java index b2a3a4dff1..96cd3a4e70 100644 --- a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java +++ b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/EffectiveIT.java @@ -86,6 +86,35 @@ public void shouldCreateFunction() throws Exception k3po.finish(); } + @Test + @Specification({ + "${app}/create.function.python/client", + "${app}/create.function.python/server" + }) + public void shouldCreateFunctionPython() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/create.function.embedded.python/client", + "${app}/create.function.embedded.python/server" }) + public void shouldCreateFunctionEmbeddedPython() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/create.function.return.struct/client", + "${app}/create.function.return.struct/server" + }) + public void shouldCreateFunctionReturnStruct() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${app}/create.function.return.table/client", diff --git a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java index ceb626e751..da1f54436f 100644 --- a/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java +++ b/incubator/binding-risingwave.spec/src/test/java/io/aklivity/zilla/specs/binding/risingwave/streams/PgsqlIT.java @@ -86,6 +86,35 @@ public void shouldCreateFunction() throws Exception k3po.finish(); } + @Test + @Specification({ + "${app}/create.function.python/client", + "${app}/create.function.python/server" + }) + public void shouldCreateFunctionPython() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/create.function.embedded.python/client", + "${app}/create.function.embedded.python/server" }) + public void shouldCreateFunctionEmbeddedPython() throws Exception + { + k3po.finish(); + } + + @Test + @Specification({ + "${app}/create.function.return.struct/client", + "${app}/create.function.return.struct/server" + }) + public void shouldCreateFunctionReturnStruct() throws Exception + { + k3po.finish(); + } + @Test @Specification({ "${app}/create.function.return.table/client", diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java index 20431d5e40..43b23bba31 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/config/RisingwaveBindingConfig.java @@ -76,11 +76,6 @@ public RisingwaveBindingConfig( location = catalogHandler.location(); } - if (options.udfs != null) - { - udf = options.udfs.get(0); - } - this.createTable = new RisingwaveCreateTableTemplate(); this.createSource = new RisingwaveCreateSourceTemplate(bootstrapServer, location, config.kafkaScanStartupTimestampMillis()); @@ -88,7 +83,7 @@ public RisingwaveBindingConfig( this.createTopic = new RisingwaveCreateTopicTemplate(); this.createView = new RisingwaveCreateMaterializedViewTemplate(); this.describeView = new RisingwaveDescribeTemplate(); - this.createFunction = new RisingwaveCreateFunctionTemplate(udf); + this.createFunction = new RisingwaveCreateFunctionTemplate(options.udfs); } public RisingwaveRouteConfig resolve( diff --git a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateFunctionTemplate.java b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateFunctionTemplate.java index 33cb6a958a..6c687b2e90 100644 --- a/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateFunctionTemplate.java +++ b/incubator/binding-risingwave/src/main/java/io/aklivity/zilla/runtime/binding/risingwave/internal/statement/RisingwaveCreateFunctionTemplate.java @@ -22,6 +22,7 @@ public class RisingwaveCreateFunctionTemplate extends RisingwaveCommandTemplate { + private static final List KEYWORDS = List.of("LANGUAGE", "AS", "USING"); private final String sqlFormat = """ CREATE FUNCTION %s(%s) RETURNS %s @@ -29,12 +30,32 @@ public class RisingwaveCreateFunctionTemplate extends RisingwaveCommandTemplate LANGUAGE %s USING LINK '%s';\u0000"""; - private final RisingwaveUdfConfig udf; + private final String java; + private final String python; public RisingwaveCreateFunctionTemplate( - RisingwaveUdfConfig udf) + List udfs) { - this.udf = udf; + String javaServer = null; + String pythonServer = null; + + if (udfs != null && !udfs.isEmpty()) + { + for (RisingwaveUdfConfig udf : udfs) + { + if (udf.language.equalsIgnoreCase("java")) + { + javaServer = udf.server; + } + else if (udf.language.equalsIgnoreCase("python")) + { + pythonServer = udf.server; + } + } + } + + this.java = javaServer; + this.python = pythonServer; } public String generate( @@ -54,33 +75,37 @@ public String generate( int returnsIndex = parts.indexOf("RETURNS"); String returnType = returnsIndex >= 0 ? parts.get(returnsIndex + 1) : ""; - if ("TABLE".equalsIgnoreCase(returnType)) + if (returnsIndex >= 0) { - int tableStartIndex = -1; - int tableEndIndex = -1; - for (int i = returnsIndex; i < parts.size(); i++) - { - if (parts.get(i).equals("(")) - { - tableStartIndex = i; - } - else if (parts.get(i).equals(")")) - { - tableEndIndex = i; - break; - } - } - - if (tableStartIndex >= 0 && tableEndIndex > tableStartIndex) - { - String tableDefinition = String.join(" ", parts.subList(tableStartIndex + 1, tableEndIndex)); - returnType += " (" + tableDefinition + ")"; - } + int nextKeywordIndex = findNextKeywordIndex(parts, returnsIndex + 1); + returnType = nextKeywordIndex >= 0 + ? String.join(" ", parts.subList(returnsIndex + 1, nextKeywordIndex)) + : String.join(" ", parts.subList(returnsIndex + 1, parts.size())); } int asIndex = parts.indexOf("AS"); String body = asIndex >= 0 ? parts.get(asIndex + 1) : ""; - return sqlFormat.formatted(functionName, parameters, returnType, body, udf.language, udf.server); + int langIndex = parts.indexOf("LANGUAGE"); + String language = langIndex >= 0 ? parts.get(langIndex + 1) : "java"; + + return sqlFormat.formatted(functionName, parameters, returnType.trim(), body, language, + "python".equalsIgnoreCase(language) ? python : java); + } + + private int findNextKeywordIndex( + List parts, + int startIndex) + { + int endIndex = -1; + for (int index = startIndex; index < parts.size(); index++) + { + if (KEYWORDS.contains(parts.get(index).toUpperCase())) + { + endIndex = index; + break; + } + } + return endIndex; } } diff --git a/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java b/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java index 9eed51a8c0..0be2a80f18 100644 --- a/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java +++ b/incubator/binding-risingwave/src/test/java/io/aklivity/zilla/runtime/binding/risingwave/internal/stream/ProxyIT.java @@ -121,6 +121,36 @@ public void shouldCreateFunction() throws Exception k3po.finish(); } + @Test + @Configuration("proxy.function.yaml") + @Specification({ + "${pgsql}/create.function.python/client", + "${effective}/create.function.python/server" }) + public void shouldCreateFunctionPython() throws Exception + { + k3po.finish(); + } + + @Test + @Configuration("proxy.function.yaml") + @Specification({ + "${pgsql}/create.function.embedded.python/client", + "${effective}/create.function.embedded.python/server" }) + public void shouldCreateFunctionEmbeddedPython() throws Exception + { + k3po.finish(); + } + + @Test + @Configuration("proxy.function.yaml") + @Specification({ + "${pgsql}/create.function.return.struct/client", + "${effective}/create.function.return.struct/server" }) + public void shouldCreateFunctionReturnStruct() throws Exception + { + k3po.finish(); + } + @Test @Configuration("proxy.function.yaml") @Specification({ From 91dfe54bae4df378c66c2f4befd1721f4ea6df3d Mon Sep 17 00:00:00 2001 From: John Fallows Date: Mon, 7 Oct 2024 13:37:20 -0700 Subject: [PATCH 6/6] Prepare release 0.9.97 --- CHANGELOG.md | 16 ++++++++++++++++ build/flyweight-maven-plugin/pom.xml | 2 +- build/pom.xml | 2 +- cloud/docker-image/pom.xml | 2 +- cloud/helm-chart/pom.xml | 2 +- cloud/pom.xml | 2 +- conf/pom.xml | 2 +- incubator/binding-amqp.spec/pom.xml | 2 +- incubator/binding-amqp/pom.xml | 2 +- incubator/binding-pgsql-kafka.spec/pom.xml | 2 +- incubator/binding-pgsql-kafka/pom.xml | 2 +- incubator/binding-pgsql.spec/pom.xml | 2 +- incubator/binding-pgsql/pom.xml | 2 +- incubator/binding-risingwave.spec/pom.xml | 2 +- incubator/binding-risingwave/pom.xml | 2 +- incubator/command-dump/pom.xml | 2 +- incubator/command-log/pom.xml | 2 +- incubator/command-tune/pom.xml | 2 +- incubator/pom.xml | 2 +- manager/pom.xml | 2 +- pom.xml | 2 +- runtime/binding-asyncapi/pom.xml | 2 +- runtime/binding-echo/pom.xml | 2 +- runtime/binding-fan/pom.xml | 2 +- runtime/binding-filesystem/pom.xml | 2 +- runtime/binding-grpc-kafka/pom.xml | 2 +- runtime/binding-grpc/pom.xml | 2 +- runtime/binding-http-filesystem/pom.xml | 2 +- runtime/binding-http-kafka/pom.xml | 2 +- runtime/binding-http/pom.xml | 2 +- runtime/binding-kafka-grpc/pom.xml | 2 +- runtime/binding-kafka/pom.xml | 2 +- runtime/binding-mqtt-kafka/pom.xml | 2 +- runtime/binding-mqtt/pom.xml | 2 +- runtime/binding-openapi-asyncapi/pom.xml | 2 +- runtime/binding-openapi/pom.xml | 2 +- runtime/binding-proxy/pom.xml | 2 +- runtime/binding-sse-kafka/pom.xml | 2 +- runtime/binding-sse/pom.xml | 2 +- runtime/binding-tcp/pom.xml | 2 +- runtime/binding-tls/pom.xml | 2 +- runtime/binding-ws/pom.xml | 2 +- runtime/catalog-apicurio/pom.xml | 2 +- runtime/catalog-filesystem/pom.xml | 2 +- runtime/catalog-inline/pom.xml | 2 +- runtime/catalog-karapace/pom.xml | 2 +- runtime/catalog-schema-registry/pom.xml | 2 +- runtime/command-metrics/pom.xml | 2 +- runtime/command-start/pom.xml | 2 +- runtime/command-stop/pom.xml | 2 +- runtime/command-version/pom.xml | 2 +- runtime/command/pom.xml | 2 +- runtime/common/pom.xml | 2 +- runtime/engine/pom.xml | 2 +- runtime/exporter-otlp/pom.xml | 2 +- runtime/exporter-prometheus/pom.xml | 2 +- runtime/exporter-stdout/pom.xml | 2 +- runtime/filesystem-http/pom.xml | 2 +- runtime/guard-jwt/pom.xml | 2 +- runtime/metrics-grpc/pom.xml | 2 +- runtime/metrics-http/pom.xml | 2 +- runtime/metrics-stream/pom.xml | 2 +- runtime/model-avro/pom.xml | 2 +- runtime/model-core/pom.xml | 2 +- runtime/model-json/pom.xml | 2 +- runtime/model-protobuf/pom.xml | 2 +- runtime/pom.xml | 2 +- runtime/resolver-env/pom.xml | 2 +- runtime/vault-filesystem/pom.xml | 2 +- specs/binding-asyncapi.spec/pom.xml | 2 +- specs/binding-echo.spec/pom.xml | 2 +- specs/binding-fan.spec/pom.xml | 2 +- specs/binding-filesystem.spec/pom.xml | 2 +- specs/binding-grpc-kafka.spec/pom.xml | 2 +- specs/binding-grpc.spec/pom.xml | 2 +- specs/binding-http-filesystem.spec/pom.xml | 2 +- specs/binding-http-kafka.spec/pom.xml | 2 +- specs/binding-http.spec/pom.xml | 2 +- specs/binding-kafka-grpc.spec/pom.xml | 2 +- specs/binding-kafka.spec/pom.xml | 2 +- specs/binding-mqtt-kafka.spec/pom.xml | 2 +- specs/binding-mqtt.spec/pom.xml | 2 +- specs/binding-openapi-asyncapi.spec/pom.xml | 2 +- specs/binding-openapi.spec/pom.xml | 2 +- specs/binding-proxy.spec/pom.xml | 2 +- specs/binding-sse-kafka.spec/pom.xml | 2 +- specs/binding-sse.spec/pom.xml | 2 +- specs/binding-tcp.spec/pom.xml | 2 +- specs/binding-tls.spec/pom.xml | 2 +- specs/binding-ws.spec/pom.xml | 2 +- specs/catalog-apicurio.spec/pom.xml | 2 +- specs/catalog-filesystem.spec/pom.xml | 2 +- specs/catalog-inline.spec/pom.xml | 2 +- specs/catalog-karapace.spec/pom.xml | 2 +- specs/catalog-schema-registry.spec/pom.xml | 2 +- specs/engine.spec/pom.xml | 2 +- specs/exporter-otlp.spec/pom.xml | 2 +- specs/exporter-prometheus.spec/pom.xml | 2 +- specs/exporter-stdout.spec/pom.xml | 2 +- specs/filesystem-http.spec/pom.xml | 2 +- specs/guard-jwt.spec/pom.xml | 2 +- specs/metrics-grpc.spec/pom.xml | 2 +- specs/metrics-http.spec/pom.xml | 2 +- specs/metrics-stream.spec/pom.xml | 2 +- specs/model-avro.spec/pom.xml | 2 +- specs/model-core.spec/pom.xml | 2 +- specs/model-json.spec/pom.xml | 2 +- specs/model-protobuf.spec/pom.xml | 2 +- specs/pom.xml | 2 +- specs/vault-filesystem.spec/pom.xml | 2 +- 110 files changed, 125 insertions(+), 109 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca073a26f3..dd317720c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [Unreleased](https://github.com/aklivity/zilla/tree/HEAD) + +[Full Changelog](https://github.com/aklivity/zilla/compare/0.9.96...HEAD) + +**Implemented enhancements:** + +- Support `jwt` guarded identity via custom token claim [\#1276](https://github.com/aklivity/zilla/issues/1276) +- Support `insert into` to seed `kafka` messages via `risingwave` binding [\#1274](https://github.com/aklivity/zilla/issues/1274) + +**Merged pull requests:** + +- `pgsql` DROP TOPIC command to KafkaDeleteTopicsBeginEx plus catalog unregister subject [\#1280](https://github.com/aklivity/zilla/pull/1280) ([akrambek](https://github.com/akrambek)) +- external udf - python support [\#1278](https://github.com/aklivity/zilla/pull/1278) ([ankitk-me](https://github.com/ankitk-me)) +- Support jwt guarded identity via custom token claim [\#1277](https://github.com/aklivity/zilla/pull/1277) ([akrambek](https://github.com/akrambek)) +- Support insert into to seed kafka messages via risingwave binding [\#1275](https://github.com/aklivity/zilla/pull/1275) ([akrambek](https://github.com/akrambek)) + ## [0.9.96](https://github.com/aklivity/zilla/tree/0.9.96) (2024-10-01) [Full Changelog](https://github.com/aklivity/zilla/compare/0.9.95...0.9.96) diff --git a/build/flyweight-maven-plugin/pom.xml b/build/flyweight-maven-plugin/pom.xml index 53d3d0dafe..5140899057 100644 --- a/build/flyweight-maven-plugin/pom.xml +++ b/build/flyweight-maven-plugin/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla build - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/build/pom.xml b/build/pom.xml index 99a8e7a8fa..a4359bad5f 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/cloud/docker-image/pom.xml b/cloud/docker-image/pom.xml index 77ee2afb38..a2c2c42c56 100644 --- a/cloud/docker-image/pom.xml +++ b/cloud/docker-image/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla cloud - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/cloud/helm-chart/pom.xml b/cloud/helm-chart/pom.xml index 261a9ba6e1..115cd8cb0b 100644 --- a/cloud/helm-chart/pom.xml +++ b/cloud/helm-chart/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla cloud - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/cloud/pom.xml b/cloud/pom.xml index eba77430c6..26b086946b 100644 --- a/cloud/pom.xml +++ b/cloud/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/conf/pom.xml b/conf/pom.xml index e7588439ef..5fce2b92a4 100644 --- a/conf/pom.xml +++ b/conf/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-amqp.spec/pom.xml b/incubator/binding-amqp.spec/pom.xml index 1dbfab0cca..afe79e85d9 100644 --- a/incubator/binding-amqp.spec/pom.xml +++ b/incubator/binding-amqp.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-amqp/pom.xml b/incubator/binding-amqp/pom.xml index 6e2783924c..6069e0f7ed 100644 --- a/incubator/binding-amqp/pom.xml +++ b/incubator/binding-amqp/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-pgsql-kafka.spec/pom.xml b/incubator/binding-pgsql-kafka.spec/pom.xml index 5c1b672147..dbf159e5a9 100644 --- a/incubator/binding-pgsql-kafka.spec/pom.xml +++ b/incubator/binding-pgsql-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-pgsql-kafka/pom.xml b/incubator/binding-pgsql-kafka/pom.xml index 5779c09cb9..d2f24cac6d 100644 --- a/incubator/binding-pgsql-kafka/pom.xml +++ b/incubator/binding-pgsql-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-pgsql.spec/pom.xml b/incubator/binding-pgsql.spec/pom.xml index 61a77e1923..157dc07223 100644 --- a/incubator/binding-pgsql.spec/pom.xml +++ b/incubator/binding-pgsql.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-pgsql/pom.xml b/incubator/binding-pgsql/pom.xml index 73bf387b5f..08d7d298a0 100644 --- a/incubator/binding-pgsql/pom.xml +++ b/incubator/binding-pgsql/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-risingwave.spec/pom.xml b/incubator/binding-risingwave.spec/pom.xml index ca30939968..de0d42a726 100644 --- a/incubator/binding-risingwave.spec/pom.xml +++ b/incubator/binding-risingwave.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/binding-risingwave/pom.xml b/incubator/binding-risingwave/pom.xml index 98571514a4..56beda2030 100644 --- a/incubator/binding-risingwave/pom.xml +++ b/incubator/binding-risingwave/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/command-dump/pom.xml b/incubator/command-dump/pom.xml index 55f058f16a..08a8a9b735 100644 --- a/incubator/command-dump/pom.xml +++ b/incubator/command-dump/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/command-log/pom.xml b/incubator/command-log/pom.xml index e437bd5ec6..89a50e343f 100644 --- a/incubator/command-log/pom.xml +++ b/incubator/command-log/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/command-tune/pom.xml b/incubator/command-tune/pom.xml index 141259687c..353d43a934 100644 --- a/incubator/command-tune/pom.xml +++ b/incubator/command-tune/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla incubator - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/incubator/pom.xml b/incubator/pom.xml index f45529d387..c694066601 100644 --- a/incubator/pom.xml +++ b/incubator/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/manager/pom.xml b/manager/pom.xml index 75c5834990..962b99d0b0 100644 --- a/manager/pom.xml +++ b/manager/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/pom.xml b/pom.xml index c0e8771930..ec5a7d6ce3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ 4.0.0 io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 pom zilla https://github.com/aklivity/zilla diff --git a/runtime/binding-asyncapi/pom.xml b/runtime/binding-asyncapi/pom.xml index 365555fd39..4982cb11cb 100644 --- a/runtime/binding-asyncapi/pom.xml +++ b/runtime/binding-asyncapi/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-echo/pom.xml b/runtime/binding-echo/pom.xml index 3a47423d5a..b44df689f6 100644 --- a/runtime/binding-echo/pom.xml +++ b/runtime/binding-echo/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-fan/pom.xml b/runtime/binding-fan/pom.xml index e88d3d6de4..b35557702d 100644 --- a/runtime/binding-fan/pom.xml +++ b/runtime/binding-fan/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-filesystem/pom.xml b/runtime/binding-filesystem/pom.xml index 25d4ae97f8..1012986a92 100644 --- a/runtime/binding-filesystem/pom.xml +++ b/runtime/binding-filesystem/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-grpc-kafka/pom.xml b/runtime/binding-grpc-kafka/pom.xml index cebcf678e4..703e99ea19 100644 --- a/runtime/binding-grpc-kafka/pom.xml +++ b/runtime/binding-grpc-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-grpc/pom.xml b/runtime/binding-grpc/pom.xml index a73bf0271e..2b86700ead 100644 --- a/runtime/binding-grpc/pom.xml +++ b/runtime/binding-grpc/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-http-filesystem/pom.xml b/runtime/binding-http-filesystem/pom.xml index 7398a08012..714e9425fa 100644 --- a/runtime/binding-http-filesystem/pom.xml +++ b/runtime/binding-http-filesystem/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-http-kafka/pom.xml b/runtime/binding-http-kafka/pom.xml index 904a2a027f..522860ce6f 100644 --- a/runtime/binding-http-kafka/pom.xml +++ b/runtime/binding-http-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-http/pom.xml b/runtime/binding-http/pom.xml index 238faec7a1..b18a1b2393 100644 --- a/runtime/binding-http/pom.xml +++ b/runtime/binding-http/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-kafka-grpc/pom.xml b/runtime/binding-kafka-grpc/pom.xml index 6d2190e68f..16ab43d0f0 100644 --- a/runtime/binding-kafka-grpc/pom.xml +++ b/runtime/binding-kafka-grpc/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-kafka/pom.xml b/runtime/binding-kafka/pom.xml index bee50a51c7..86aba12931 100644 --- a/runtime/binding-kafka/pom.xml +++ b/runtime/binding-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-mqtt-kafka/pom.xml b/runtime/binding-mqtt-kafka/pom.xml index 5c461f327e..23360ce1f4 100644 --- a/runtime/binding-mqtt-kafka/pom.xml +++ b/runtime/binding-mqtt-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-mqtt/pom.xml b/runtime/binding-mqtt/pom.xml index 1ce005dd67..f909c47a48 100644 --- a/runtime/binding-mqtt/pom.xml +++ b/runtime/binding-mqtt/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-openapi-asyncapi/pom.xml b/runtime/binding-openapi-asyncapi/pom.xml index ab4e193680..ab32ca681e 100644 --- a/runtime/binding-openapi-asyncapi/pom.xml +++ b/runtime/binding-openapi-asyncapi/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-openapi/pom.xml b/runtime/binding-openapi/pom.xml index 9b891fb878..40ba244303 100644 --- a/runtime/binding-openapi/pom.xml +++ b/runtime/binding-openapi/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-proxy/pom.xml b/runtime/binding-proxy/pom.xml index e55a09fb6a..690ff6cf2a 100644 --- a/runtime/binding-proxy/pom.xml +++ b/runtime/binding-proxy/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-sse-kafka/pom.xml b/runtime/binding-sse-kafka/pom.xml index dca069639d..040dd67b82 100644 --- a/runtime/binding-sse-kafka/pom.xml +++ b/runtime/binding-sse-kafka/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-sse/pom.xml b/runtime/binding-sse/pom.xml index f66588e0a8..d95b35d641 100644 --- a/runtime/binding-sse/pom.xml +++ b/runtime/binding-sse/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-tcp/pom.xml b/runtime/binding-tcp/pom.xml index f26574a201..be696937b9 100644 --- a/runtime/binding-tcp/pom.xml +++ b/runtime/binding-tcp/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-tls/pom.xml b/runtime/binding-tls/pom.xml index 602b6ed554..b34236e70d 100644 --- a/runtime/binding-tls/pom.xml +++ b/runtime/binding-tls/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/binding-ws/pom.xml b/runtime/binding-ws/pom.xml index 0018b956cc..84f190e598 100644 --- a/runtime/binding-ws/pom.xml +++ b/runtime/binding-ws/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/catalog-apicurio/pom.xml b/runtime/catalog-apicurio/pom.xml index 55d5212fd0..22a4144c16 100644 --- a/runtime/catalog-apicurio/pom.xml +++ b/runtime/catalog-apicurio/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/catalog-filesystem/pom.xml b/runtime/catalog-filesystem/pom.xml index fbe0587393..b84133156a 100644 --- a/runtime/catalog-filesystem/pom.xml +++ b/runtime/catalog-filesystem/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/catalog-inline/pom.xml b/runtime/catalog-inline/pom.xml index 71f8d0daf9..ee7b222959 100644 --- a/runtime/catalog-inline/pom.xml +++ b/runtime/catalog-inline/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/catalog-karapace/pom.xml b/runtime/catalog-karapace/pom.xml index f144b9249b..97e6ae27ae 100644 --- a/runtime/catalog-karapace/pom.xml +++ b/runtime/catalog-karapace/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/catalog-schema-registry/pom.xml b/runtime/catalog-schema-registry/pom.xml index 454beeb2c1..319b69c774 100644 --- a/runtime/catalog-schema-registry/pom.xml +++ b/runtime/catalog-schema-registry/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/command-metrics/pom.xml b/runtime/command-metrics/pom.xml index db5bc81d49..04f7864263 100644 --- a/runtime/command-metrics/pom.xml +++ b/runtime/command-metrics/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/command-start/pom.xml b/runtime/command-start/pom.xml index 8ed869e0d7..8b98acdfc8 100644 --- a/runtime/command-start/pom.xml +++ b/runtime/command-start/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/command-stop/pom.xml b/runtime/command-stop/pom.xml index 76ba8f778f..2686e756c5 100644 --- a/runtime/command-stop/pom.xml +++ b/runtime/command-stop/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/command-version/pom.xml b/runtime/command-version/pom.xml index 36c49192af..b7b31f2153 100644 --- a/runtime/command-version/pom.xml +++ b/runtime/command-version/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/command/pom.xml b/runtime/command/pom.xml index 8163d6fa6c..e673eae8a6 100644 --- a/runtime/command/pom.xml +++ b/runtime/command/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/common/pom.xml b/runtime/common/pom.xml index 7bcda309e4..628d3162c7 100644 --- a/runtime/common/pom.xml +++ b/runtime/common/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/engine/pom.xml b/runtime/engine/pom.xml index bf412f219e..6048017d99 100644 --- a/runtime/engine/pom.xml +++ b/runtime/engine/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/exporter-otlp/pom.xml b/runtime/exporter-otlp/pom.xml index 5bfaac5e8c..12a0544f6e 100644 --- a/runtime/exporter-otlp/pom.xml +++ b/runtime/exporter-otlp/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/exporter-prometheus/pom.xml b/runtime/exporter-prometheus/pom.xml index b3af26bd40..6be180e600 100644 --- a/runtime/exporter-prometheus/pom.xml +++ b/runtime/exporter-prometheus/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/exporter-stdout/pom.xml b/runtime/exporter-stdout/pom.xml index 6263e5350c..29c29b8aa3 100644 --- a/runtime/exporter-stdout/pom.xml +++ b/runtime/exporter-stdout/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/filesystem-http/pom.xml b/runtime/filesystem-http/pom.xml index f944c54a49..9bab57bdb5 100644 --- a/runtime/filesystem-http/pom.xml +++ b/runtime/filesystem-http/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/guard-jwt/pom.xml b/runtime/guard-jwt/pom.xml index ebba56e5b5..afc9802559 100644 --- a/runtime/guard-jwt/pom.xml +++ b/runtime/guard-jwt/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/metrics-grpc/pom.xml b/runtime/metrics-grpc/pom.xml index 310b473e19..cc76d4ffd3 100644 --- a/runtime/metrics-grpc/pom.xml +++ b/runtime/metrics-grpc/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/metrics-http/pom.xml b/runtime/metrics-http/pom.xml index 4a27ee2483..5e54ddd369 100644 --- a/runtime/metrics-http/pom.xml +++ b/runtime/metrics-http/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/metrics-stream/pom.xml b/runtime/metrics-stream/pom.xml index 6021c37669..3797a07cf3 100644 --- a/runtime/metrics-stream/pom.xml +++ b/runtime/metrics-stream/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/model-avro/pom.xml b/runtime/model-avro/pom.xml index ddfe3781ec..87bf728b91 100644 --- a/runtime/model-avro/pom.xml +++ b/runtime/model-avro/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/model-core/pom.xml b/runtime/model-core/pom.xml index 406a2f987e..a339c058f6 100644 --- a/runtime/model-core/pom.xml +++ b/runtime/model-core/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/model-json/pom.xml b/runtime/model-json/pom.xml index 8dd5e143b4..e160617d55 100644 --- a/runtime/model-json/pom.xml +++ b/runtime/model-json/pom.xml @@ -6,7 +6,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/model-protobuf/pom.xml b/runtime/model-protobuf/pom.xml index e96a2f6b94..12ca2db469 100644 --- a/runtime/model-protobuf/pom.xml +++ b/runtime/model-protobuf/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/pom.xml b/runtime/pom.xml index d42e0cc398..5ffe088ab2 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/resolver-env/pom.xml b/runtime/resolver-env/pom.xml index a5c86d1070..f1c0282e9e 100644 --- a/runtime/resolver-env/pom.xml +++ b/runtime/resolver-env/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/runtime/vault-filesystem/pom.xml b/runtime/vault-filesystem/pom.xml index a856149b05..692d3d47c7 100644 --- a/runtime/vault-filesystem/pom.xml +++ b/runtime/vault-filesystem/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla runtime - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-asyncapi.spec/pom.xml b/specs/binding-asyncapi.spec/pom.xml index 55fe296472..d06094f8b0 100644 --- a/specs/binding-asyncapi.spec/pom.xml +++ b/specs/binding-asyncapi.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-echo.spec/pom.xml b/specs/binding-echo.spec/pom.xml index 02660f2ad2..1d670cb207 100644 --- a/specs/binding-echo.spec/pom.xml +++ b/specs/binding-echo.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-fan.spec/pom.xml b/specs/binding-fan.spec/pom.xml index 0256388967..e958766e7c 100644 --- a/specs/binding-fan.spec/pom.xml +++ b/specs/binding-fan.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-filesystem.spec/pom.xml b/specs/binding-filesystem.spec/pom.xml index 32ed1f9cb4..658acdc779 100644 --- a/specs/binding-filesystem.spec/pom.xml +++ b/specs/binding-filesystem.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-grpc-kafka.spec/pom.xml b/specs/binding-grpc-kafka.spec/pom.xml index 3721a7cfad..03dbcf18aa 100644 --- a/specs/binding-grpc-kafka.spec/pom.xml +++ b/specs/binding-grpc-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-grpc.spec/pom.xml b/specs/binding-grpc.spec/pom.xml index eaf6d7b1a6..caedaf2765 100644 --- a/specs/binding-grpc.spec/pom.xml +++ b/specs/binding-grpc.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-http-filesystem.spec/pom.xml b/specs/binding-http-filesystem.spec/pom.xml index e8164f7ab4..f913b91f87 100644 --- a/specs/binding-http-filesystem.spec/pom.xml +++ b/specs/binding-http-filesystem.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-http-kafka.spec/pom.xml b/specs/binding-http-kafka.spec/pom.xml index be894338f9..871e81f544 100644 --- a/specs/binding-http-kafka.spec/pom.xml +++ b/specs/binding-http-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-http.spec/pom.xml b/specs/binding-http.spec/pom.xml index 61282d8951..6cecaabc2d 100644 --- a/specs/binding-http.spec/pom.xml +++ b/specs/binding-http.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-kafka-grpc.spec/pom.xml b/specs/binding-kafka-grpc.spec/pom.xml index c9ec172761..96e689aa78 100644 --- a/specs/binding-kafka-grpc.spec/pom.xml +++ b/specs/binding-kafka-grpc.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-kafka.spec/pom.xml b/specs/binding-kafka.spec/pom.xml index 129341bd51..21e53f8b6c 100644 --- a/specs/binding-kafka.spec/pom.xml +++ b/specs/binding-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-mqtt-kafka.spec/pom.xml b/specs/binding-mqtt-kafka.spec/pom.xml index 2941bcfc83..1ee013e8ae 100644 --- a/specs/binding-mqtt-kafka.spec/pom.xml +++ b/specs/binding-mqtt-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-mqtt.spec/pom.xml b/specs/binding-mqtt.spec/pom.xml index 9f16169b5a..d265d955b7 100644 --- a/specs/binding-mqtt.spec/pom.xml +++ b/specs/binding-mqtt.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-openapi-asyncapi.spec/pom.xml b/specs/binding-openapi-asyncapi.spec/pom.xml index b1913e3065..94f3d851f2 100644 --- a/specs/binding-openapi-asyncapi.spec/pom.xml +++ b/specs/binding-openapi-asyncapi.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-openapi.spec/pom.xml b/specs/binding-openapi.spec/pom.xml index 7a1c356c94..6d846b2711 100644 --- a/specs/binding-openapi.spec/pom.xml +++ b/specs/binding-openapi.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-proxy.spec/pom.xml b/specs/binding-proxy.spec/pom.xml index 4408d55147..a7b1b2885a 100644 --- a/specs/binding-proxy.spec/pom.xml +++ b/specs/binding-proxy.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-sse-kafka.spec/pom.xml b/specs/binding-sse-kafka.spec/pom.xml index b72428eb1b..45d3893762 100644 --- a/specs/binding-sse-kafka.spec/pom.xml +++ b/specs/binding-sse-kafka.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-sse.spec/pom.xml b/specs/binding-sse.spec/pom.xml index 7079f2e1ae..c0325cbb59 100644 --- a/specs/binding-sse.spec/pom.xml +++ b/specs/binding-sse.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-tcp.spec/pom.xml b/specs/binding-tcp.spec/pom.xml index 0c30ded08e..9b648b6f3f 100644 --- a/specs/binding-tcp.spec/pom.xml +++ b/specs/binding-tcp.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-tls.spec/pom.xml b/specs/binding-tls.spec/pom.xml index fdc955ef96..c6f545ee78 100644 --- a/specs/binding-tls.spec/pom.xml +++ b/specs/binding-tls.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/binding-ws.spec/pom.xml b/specs/binding-ws.spec/pom.xml index 5dc9b1a9b6..b48c19c8fb 100644 --- a/specs/binding-ws.spec/pom.xml +++ b/specs/binding-ws.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/catalog-apicurio.spec/pom.xml b/specs/catalog-apicurio.spec/pom.xml index 444c97efb8..00def73d78 100644 --- a/specs/catalog-apicurio.spec/pom.xml +++ b/specs/catalog-apicurio.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/catalog-filesystem.spec/pom.xml b/specs/catalog-filesystem.spec/pom.xml index 3c39bb0d06..a1eababef0 100644 --- a/specs/catalog-filesystem.spec/pom.xml +++ b/specs/catalog-filesystem.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/catalog-inline.spec/pom.xml b/specs/catalog-inline.spec/pom.xml index 8a90f4e4cb..7660cdc502 100644 --- a/specs/catalog-inline.spec/pom.xml +++ b/specs/catalog-inline.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/catalog-karapace.spec/pom.xml b/specs/catalog-karapace.spec/pom.xml index 3e150cf9b4..181f306deb 100644 --- a/specs/catalog-karapace.spec/pom.xml +++ b/specs/catalog-karapace.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/catalog-schema-registry.spec/pom.xml b/specs/catalog-schema-registry.spec/pom.xml index e822b9989c..9a8a541641 100644 --- a/specs/catalog-schema-registry.spec/pom.xml +++ b/specs/catalog-schema-registry.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/engine.spec/pom.xml b/specs/engine.spec/pom.xml index b3b73bb237..b32017696e 100644 --- a/specs/engine.spec/pom.xml +++ b/specs/engine.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/exporter-otlp.spec/pom.xml b/specs/exporter-otlp.spec/pom.xml index 9f5df63979..3de4da33e8 100644 --- a/specs/exporter-otlp.spec/pom.xml +++ b/specs/exporter-otlp.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/exporter-prometheus.spec/pom.xml b/specs/exporter-prometheus.spec/pom.xml index 935f76f3e0..d1a2fbc17c 100644 --- a/specs/exporter-prometheus.spec/pom.xml +++ b/specs/exporter-prometheus.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/exporter-stdout.spec/pom.xml b/specs/exporter-stdout.spec/pom.xml index 359074548d..18b1557673 100644 --- a/specs/exporter-stdout.spec/pom.xml +++ b/specs/exporter-stdout.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/filesystem-http.spec/pom.xml b/specs/filesystem-http.spec/pom.xml index 98bf6f77aa..d3791991be 100644 --- a/specs/filesystem-http.spec/pom.xml +++ b/specs/filesystem-http.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/guard-jwt.spec/pom.xml b/specs/guard-jwt.spec/pom.xml index 1c9ee70d5a..92ddafd962 100644 --- a/specs/guard-jwt.spec/pom.xml +++ b/specs/guard-jwt.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/metrics-grpc.spec/pom.xml b/specs/metrics-grpc.spec/pom.xml index 72a14cd179..3b61460c34 100644 --- a/specs/metrics-grpc.spec/pom.xml +++ b/specs/metrics-grpc.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/metrics-http.spec/pom.xml b/specs/metrics-http.spec/pom.xml index 292e82a329..c167c0d929 100644 --- a/specs/metrics-http.spec/pom.xml +++ b/specs/metrics-http.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/metrics-stream.spec/pom.xml b/specs/metrics-stream.spec/pom.xml index bc5ef9c6a0..4b8c5a824b 100644 --- a/specs/metrics-stream.spec/pom.xml +++ b/specs/metrics-stream.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/model-avro.spec/pom.xml b/specs/model-avro.spec/pom.xml index 3599ba1aa3..fd73e029b7 100644 --- a/specs/model-avro.spec/pom.xml +++ b/specs/model-avro.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/model-core.spec/pom.xml b/specs/model-core.spec/pom.xml index 9b5b0b41ec..0ad8c3c55a 100644 --- a/specs/model-core.spec/pom.xml +++ b/specs/model-core.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/model-json.spec/pom.xml b/specs/model-json.spec/pom.xml index c7e0a3ab97..10c8ce9306 100644 --- a/specs/model-json.spec/pom.xml +++ b/specs/model-json.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/model-protobuf.spec/pom.xml b/specs/model-protobuf.spec/pom.xml index f040110f1d..eeec3f4b7b 100644 --- a/specs/model-protobuf.spec/pom.xml +++ b/specs/model-protobuf.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/pom.xml b/specs/pom.xml index a04ebc5efe..fd64db3db4 100644 --- a/specs/pom.xml +++ b/specs/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla zilla - develop-SNAPSHOT + 0.9.97 ../pom.xml diff --git a/specs/vault-filesystem.spec/pom.xml b/specs/vault-filesystem.spec/pom.xml index fbf4dbaad6..cf14664e05 100644 --- a/specs/vault-filesystem.spec/pom.xml +++ b/specs/vault-filesystem.spec/pom.xml @@ -8,7 +8,7 @@ io.aklivity.zilla specs - develop-SNAPSHOT + 0.9.97 ../pom.xml