-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[improvement](sql-dialect) support multiple servers of dialect sql converter #36674
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
2 questions:
|
Yes, what you mentioned above is that each FE can use at most one dialect converter server. In this PR, each FE can use multi dialect converter servers using polling. Check to see if this PR is needed? If don’t need it, you can close it. |
I don't think we need to start multi converter servers for a single FE? |
} | ||
|
||
public PluginInfo getPluginInfo() { | ||
return pluginInfo; | ||
} | ||
|
||
private static void analyzeConverterSevicesInfo() { | ||
String dialectConverterServices = Config.dialect_converter_services; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double spaces after String
return resultStr; | ||
} | ||
} | ||
return originSql; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log here if the conversion fails?
The log should contain how many times tried and which server has been tried.
|
||
int retryCount = 0; | ||
while (retryCount < dialectConverterSerInfo.size()) { | ||
String chooseServer = dialectConverterSerInfo.get(chooseServerIdx++ % dialectConverterSerInfo.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may have to skip the servers that have been marked unavailable, which can be deduced by line 152, for better availability.
e.g. remember some unavailable servers, and reduce the possibility accessing that servers with a back-off algorithm.
@@ -2612,6 +2612,10 @@ public class Config extends ConfigBase { | |||
public static boolean enable_proxy_protocol = false; | |||
public static int profile_async_collect_expire_time_secs = 5; | |||
|
|||
@ConfField(description = {"方言转换服务器地址", | |||
"Dialect translation services info"}) | |||
public static String dialect_converter_services = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an example here, what the format is
e.g. a.com:8080;b.com:8090
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix some obvious errors and consider further improvement.
Add a new FE Config
dialect_converter_services
.If this config is set, and the session variable
enableMultiDialectConvertService
is set,Doris will poll using multiple sql converter services to convert user input sql to
specified sql dialect. but if the session variable
sql_converter_service_url
is set at the same time, use session variablesql_converter_service_url
. eg:set fe.conf:
dialect_converter_services = 192.168.1.13:5001;192.168.1.13:5002;192.168.1.13:5003;192.168.1.13:5004