sqlflow icon indicating copy to clipboard operation
sqlflow copied to clipboard

Allow string as the param of USING keyword

Open lhw362950217 opened this issue 5 years ago • 3 comments

Currently, we use IDENT as the param of USING in prediction clause. In order to support using model in Model Zoo, we changed the IDENT to allow characters like [/_:.]. It may not be a good choice, for example, we can't specify an ip as a model zoo server like USING 192.168.0.33/my_db.my_model:v1. How about change the syntax to below and keep the IDENT in normal identifier character set.

using_clause
  : USING IDENT
  | USING STRING
  ;

lhw362950217 avatar Jul 30 '20 08:07 lhw362950217

https://github.com/sql-machine-learning/sqlflow/blob/484753fc49e3974cc2fe2a18dd6cc31c2e3cfc51/go/parser/lexer.go#L185-L202

The IDENT can represent characters like [/_:.] currently I think.

typhoonzero avatar Jul 30 '20 09:07 typhoonzero

https://github.com/sql-machine-learning/sqlflow/blob/484753fc49e3974cc2fe2a18dd6cc31c2e3cfc51/go/parser/lexer.go#L185-L202

The IDENT can represent characters like [/_:.] currently I think.

My thought is to revert the IDENT to just has characters in [a-zA-Z_.] and allow USING followed by string. So the clause USING "192.168.0.33/my_db.my_model:v1" can work. Sometimes, the model zoo server part can be a numbered-ip.

lhw362950217 avatar Jul 30 '20 09:07 lhw362950217

I see, sounds good. By the way, we may need to update TO TRAIN clause also.

typhoonzero avatar Jul 31 '20 02:07 typhoonzero