zalando-incubator/clin

Modifying the SQL of a nakadi-sql query fails

barry-hennessy opened this issue · 4 comments

Expected Behavior

When modifying the SQL of a Nakadi SQL query with clin apply the request either successfully updates (if the SQL change is valid) or fails with an error as to why the SQL change is not valid (i.e. the error coming from Nakadi).

Actual Behavior

Updating the SQL results in an error:

× Modifying output event type is forbidden: ...

It looks like clin is trying to update the whole event, and not using the /sql sub-resource of the query to update the query itself.

Steps to Reproduce the Problem

  1. Create a Nakadi SQL query
    • clin apply -t ... -e ... docs/examples/single/sql-query.yaml -X)
  2. Change the WHERE portion of the query
    • e.g.
diff --git a/docs/examples/single/sql-query.yaml b/docs/examples/single/sql-query.yaml
index 5c2d0f2..fb90be2 100644
--- a/docs/examples/single/sql-query.yaml
+++ b/docs/examples/single/sql-query.yaml
@@ -4,7 +4,7 @@ spec:
   sql: |
     SELECT *
     FROM "derokhin.clin.test" AS e
-    WHERE e."important_key" = 'hello world'
+    WHERE e."important_key" = 'hello world' OR e."important_key" = 'new phone. Who dis?'
   envelope: false
   outputEventType:
     category: business # business | data | undefined
  1. Update the Nakadi SQL query
    • clin apply -t ... -e ... docs/examples/single/sql-query.yaml -X)

Specifications

  • Version: 1.2.2
  • Platform: OSx 10.15
  • Subsystem: Python 3.9.1

Hi @Dmitry-Erokhin I just want to check if you need any more information from me.

@barry-hennessy no, all is clear. I'm working on it.

Fixed in version 2.2.3 please update tool pip3 install -U clin