Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: sink syntax not consist with doc #15276

Closed
yufansong opened this issue Feb 26, 2024 · 3 comments
Closed

Bug: sink syntax not consist with doc #15276

yufansong opened this issue Feb 26, 2024 · 3 comments
Assignees
Labels
type/bug Something isn't working
Milestone

Comments

@yufansong
Copy link
Member

yufansong commented Feb 26, 2024

Describe the bug

In our doc, it seems we already claim all sink already support FORMAT ... ENCODE ... syntax. We do this change in #12556, but acutally not all sink support it. For example our NATS doc, the example command is:

CREATE SINK [ IF NOT EXISTS ] sink_name
[FROM sink_from | AS select_query]
WITH (
   connector='nats',
   server_url='<your nats server>:<port>', [ <another_server_url_if_available>, ...]
   subject='<your subject>',

 -- optional parameters
   connect_mode=<connect_mode>
   username='<your user name>',
   password='<your password>'
   jwt=`<your jwt>`,
   nkey=`<your nkey>`
)
FORMAT PLAIN ENCODE JSON;

But when try locally in latest main, it will show:

dev=> create sink s1 as
dev-> select
dev->     *
dev-> from
dev->     person with (
dev(>         connector = 'nats',
dev(>         server_url = 'localhost:4222',
dev(>         subject = 'event1',
dev(>     ) format plain encode json;
ERROR:  Failed to run the query

Caused by:
  Bind error: connector nats is not supported by FORMAT ... ENCODE ... syntax
dev=> 

I guess some other sink doc may also exist this problem.

Error message/log

No response

To Reproduce

Start nats locally nats-server -js
Then try following:

CREATE TABLE person (
    id integer,
    name varchar,
);

INSERT INTO person VALUES (1, 'Alice'), (2, 'Bob');
INSERT INTO person VALUES (3, 'Tom'), (4, 'Jerry');

FLUSH;

# this will fail
create sink s1 as
select
    *
from
    person with (
        connector = 'nats',
        server_url = 'localhost:4222',
        subject = 'event1',
    ) format plain encode json;

# this will sucess
create sink s1 as
select
    *
from
    person with (
        connector = 'nats',
server_url = '0.0.0.0:4222',
subject = 'event1',
type = 'append-only',
force_append_only = 'true',
connect_mode = 'plain'
    );

Expected behavior

No response

How did you deploy RisingWave?

No response

The version of RisingWave

No response

Additional context

No response

@yufansong yufansong added the type/bug Something isn't working label Feb 26, 2024
@github-actions github-actions bot added this to the release-1.7 milestone Feb 26, 2024
@neverchanje
Copy link
Contributor

I've no idea that

create sink s1 as
select
    *
from
    person with (
        connector = 'nats',
        server_url = 'localhost:4222',
        subject = 'event1',
    ) format plain encode json;

this will fail. @xiangjinwu Please help investigate the root cause. It's a kernel bug rather than a doc bug. Thanks.

@xiangjinwu
Copy link
Contributor

xiangjinwu commented Feb 27, 2024

The documentation section of the aforementioned PR clearly states that only kafka/kinesis/pulsar have been migrated to the new syntax. But yes we shall migrate nats as well.

Before that is actually done, doc shall be updated to match whatever kernel have implemented, acknowledging certain limitations.

@yufansong
Copy link
Member Author

closed by changing docs https://github.com/risingwavelabs/risingwave-docs/pull/1921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants