RFC-003: New SQL syntax: support HAVING clause and LIKE operator #686
jingchen2222
started this conversation in
RFCs
Replies: 1 comment
-
here are detail rules/works I'd consider @jingchen2222
Escape character:
To write backslash in sql string literal, one must write as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Status: Approved
Problem
Currently, OpenMLDB doesn't support certain SQL syntaxes like the HAVING clause and the LIKE operator. These abilities are required by data scientists for data analysis.
HAVING Clause
Related issue: #547
HAVING clause in SQL specifies that an SQL SELECT statement must only return rows where aggregate values meet the specified conditions.
Generally, the HAVING clause is used in conjunction with aggregate functions and the GROUP BY clause to control which groups are selected.
Example:
LIKE expression
Related issue: #224
LIKE
is a logical operator that determines if a character string matches a specified pattern. A pattern may include regular characters and wildcard characters.Example:
Solution
Support HAVING clause in SELECT statement
Syntax
The syntax for the HAVING clause in SQL is:
Constraints:
WINDOW
clause.Support LIKE operator and ESCAPE operator
Syntax
Parameters
search_pattern:
Specifies a string pattern to be searched by the
LIKE
clause. It can contain special pattern-matching characters:%
) matches zero or more characters._
) matches exactly one character.esc_char: Specifies the escape character.
\
).the
LIKE
is case sensitive, there will also beILIKE
, which is the case insensitive version of likeConstraints:
Changes and Additions to Public Interfaces
This is the new component and will not affect the public interface
Performance Impact
This is the new component and will not affect the current performance.
Backwards Compatibility and Upgrade Path
This is the new component and doesn't have backwards compatibility and upgrade issues.
Related Work
#547
#224
References
Beta Was this translation helpful? Give feedback.
All reactions