-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](hyperscan) Fix hyper scan fall back to re2 (#44547)
* Core modification When hyper scan failed, we should not set_error in FunctionContext. Since set_error will try cancel query, but actually we want to fall back to re2 in this case. * Some refactor Rename FunctionRegexp so that we can distinguish regexp match with regexp_extract. * Reproduce ```cpp SELECT * FROM regexp_test_chinese WHERE city REGEXP "^上海|^北京" ORDER BY id; ``` Note, the `|` in above sql is a Chinese character.
- Loading branch information
1 parent
aca0eaa
commit df5bfe8
Showing
5 changed files
with
57 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
regression-test/data/query_p0/sql_functions/string_functions/test_regexp_chinese.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !sql_regexp -- | ||
|
35 changes: 35 additions & 0 deletions
35
regression-test/suites/query_p0/sql_functions/string_functions/test_regexp_chinese.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
suite("test_regexp_chinese") { | ||
sql "DROP TABLE IF EXISTS regexp_test_chinese;" | ||
sql """ | ||
CREATE TABLE regexp_test_chinese ( | ||
id int NULL DEFAULT "0", | ||
city varchar(50) NOT NULL DEFAULT "" | ||
) DISTRIBUTED BY HASH(id) BUCKETS 5 properties("replication_num" = "1"); | ||
""" | ||
|
||
sql """ | ||
INSERT INTO regexp_test_chinese VALUES(1, "上海"),(2, "深圳"),(3, "上海测试"), (4, "北京测试"); | ||
""" | ||
|
||
qt_sql_regexp """ | ||
SELECT * FROM regexp_test_chinese WHERE city REGEXP "^上海|^北京" ORDER BY id; | ||
""" | ||
} | ||
|