-
Notifications
You must be signed in to change notification settings - Fork 139
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
[FEATURE] Make OpenSearch function registered dynamically #811
Comments
Sure, we need to figure out a general way and allow each storage engine to register specific data type and function dynamically. Earlier our storage engine interface was referencing Apache Calcite. Probably we can explore further here: https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/schema/Schema.java |
Another think to add: we need to move the analyzers relevant to the user-defined functions (such as the |
That'd great be if we can do that for highlight as well. I've met this problem with highlight operator when refactor optimizer: https://github.com/opensearch-project/sql/pull/1091/files#diff-3334dc7821335d1c35cb35e3da00960106b6ac04c4ca092937c51c076056d272R103. I have to add a |
@acarbonetto create issue to determine if we can split work up into the following:
|
Is your feature request related to a problem?
Currently all OpenSearch functions are "hardcoded" in ANTLR grammar file. As external storage like S3 and Prometheus added, this will cause problem. For example, in current implementation, query like "... FROM s3.logs WHERE QUERY_STRING(...)" can pass ANTLR parser but fail at execution time due to missing
QUERY_STRING
function support in S3 storage.What solution would you like?
One approach is each storage engine registers specific function dynamically when plugin bootstraps. The ANTLR grammar only includes common ANSI SQL functions that has in-memory implementation along with a new
udf
rule that match unrecognized functions as User-Defined Function. Later analyzer can verify if the UDF is valid or not. This approach naturally provides UDF support for future.What alternatives have you considered?
N/A
Do you have any additional context?
N/A
The text was updated successfully, but these errors were encountered: