@@ -3210,13 +3210,6 @@ impl<'a> Parser<'a> {
3210
3210
Keyword::OR => Some(BinaryOperator::Or),
3211
3211
Keyword::XOR => Some(BinaryOperator::Xor),
3212
3212
Keyword::OVERLAPS => Some(BinaryOperator::Overlaps),
3213
- // Doris match operators
3214
- Keyword::MATCH_ALL => Some(BinaryOperator::MatchAll),
3215
- Keyword::MATCH_ANY => Some(BinaryOperator::MatchAny),
3216
- Keyword::MATCH_PHRASE => Some(BinaryOperator::MatchPhrase),
3217
- Keyword::MATCH_PHRASE_PREFIX => Some(BinaryOperator::MatchPhrasePrefix),
3218
- Keyword::MATCH_PHRASE_EDGE => Some(BinaryOperator::MatchPhraseEdge),
3219
- Keyword::MATCH_REGEXP => Some(BinaryOperator::MatchRegexp),
3220
3213
Keyword::OPERATOR if dialect_is!(dialect is PostgreSqlDialect | GenericDialect) => {
3221
3214
self.expect_token(&Token::LParen)?;
3222
3215
// there are special rules for operator names in
@@ -3234,6 +3227,21 @@ impl<'a> Parser<'a> {
3234
3227
self.expect_token(&Token::RParen)?;
3235
3228
Some(BinaryOperator::PGCustomBinaryOperator(idents))
3236
3229
}
3230
+ // Doris match operators
3231
+ Keyword::MATCH_ALL => dialect_is!(dialect is MySqlDialect | GenericDialect)
3232
+ .then_some(BinaryOperator::MatchAll),
3233
+ Keyword::MATCH_ANY => dialect_is!(dialect is MySqlDialect | GenericDialect)
3234
+ .then_some(BinaryOperator::MatchAny),
3235
+ Keyword::MATCH_PHRASE => dialect_is!(dialect is MySqlDialect | GenericDialect)
3236
+ .then_some(BinaryOperator::MatchPhrase),
3237
+ Keyword::MATCH_PHRASE_PREFIX => {
3238
+ dialect_is!(dialect is MySqlDialect | GenericDialect)
3239
+ .then_some(BinaryOperator::MatchPhrasePrefix)
3240
+ }
3241
+ Keyword::MATCH_PHRASE_EDGE => dialect_is!(dialect is MySqlDialect | GenericDialect)
3242
+ .then_some(BinaryOperator::MatchPhraseEdge),
3243
+ Keyword::MATCH_REGEXP => dialect_is!(dialect is MySqlDialect | GenericDialect)
3244
+ .then_some(BinaryOperator::MatchRegexp),
3237
3245
_ => None,
3238
3246
},
3239
3247
_ => None,
@@ -15435,7 +15443,6 @@ mod tests {
15435
15443
fn test_doris_match_operators() {
15436
15444
let dialect = &MySqlDialect {};
15437
15445
15438
- // 测试用例
15439
15446
// Copy from https://doris.apache.org/docs/table-design/index/inverted-index
15440
15447
let test_cases = [
15441
15448
// 1.1
0 commit comments