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

Help adding parser support for stream #6306

Open
derekperkins opened this issue Jun 12, 2020 · 1 comment
Open

Help adding parser support for stream #6306

derekperkins opened this issue Jun 12, 2020 · 1 comment

Comments

@derekperkins
Copy link
Member

Currently the only way to subscribe to messages via SQL is to run stream * from msg_tbl. It seems like it should be trivial to add support to the parser for column selection, stream col1, col2 from msg_tbl for someone with experience with yacc. Once there is parser support, I can make sure that it plumbs through messages properly. cc @systay
https://github.com/vitessio/vitess/blob/master/go/vt/sqlparser/sql.y#L413-L417

#5882

@nstandif
Copy link

nstandif commented Jun 15, 2020

select_expression was used instead of select_expression_list in both the AST and the yacc. You'd need to change both in order to plumb it out correctly.

https://github.com/vitessio/vitess/blob/master/go/vt/sqlparser/sql.y#L413-L417

stream_statement:
  STREAM comment_opt select_expression_list FROM table_name
  {
    $$ = &Stream{Comments: Comments($2), SelectExprs: $3, Table: $5}
  }

https://github.com/vitessio/vitess/blob/master/go/vt/sqlparser/ast.go#L83-L87

	Stream struct {
		Comments   Comments
		SelectExprs SelectExprs
		Table      TableName
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants