Closed shawn-happy closed 3 years ago
thanks for the suggestion, @dl239 will follow up this issue BTW, can you please elaborate on your requirements and potential solutions about this issue? We are looking forward to your contribution.
example:
the sql parameter is a query statements such as :
SELECT a.itemId as itemId, b.brandName as name, b.brandId as brandId, c.actionValue as label FROM a LAST JOIN c ON c.itemId = a.itemId LAST JOIN adinfo ON a.itemId = b.id;
the tableMap parameter is Is used to indicate the mapping between tables and schemas of each table:
{ "a": [ { "name": "itemId", "type": "string" }, { "name": "reqId", "type": "string" } ], "b": [ { "name": "id", "type": "string" } ], "c": [ { "name": "itemId", "type": "string" }, { "name": "reqId", "type": "string" } ] }
rpc ExecuteDDLParser(DDLParserRequest) returns (DDLParserResponse);
message DDLParserRequest{ optional string sql = 3; optional string table = 3; repeated openmldb.common.ColumnDesc column_desc= 1; }
message DDLParserResponse{ optional int32 code = 2; optional string msg = 3; repeated string ddl = 1; }
void ExecuteDDLParser(RpcController* controller, const DDLParserRequest* request, DDLParserResponse* response, Closure* done);
@dl239 @vagetablechicken please review this solution to give me some advice
Maybe ExtractIndexRequest
is better, or DDLParseRequest
, not parser request.
We want to support tables, but request only has one table and its columns. You could try inner message, like:
message Request {
message Table{
optional table_name;
repeated cols;
}
repeated Table tables;
}
Why add ExecuteDDLParser
rpc interface to server? @shawn-happy
i want to auto create table in server after genDDl statement @dl239
create ddl parser api for java sdk.