Commit Graph

1209 Commits

Author SHA1 Message Date
caacee253d [fix](olap)Crashing caused by IS NULL expression (#17463)
Issue Number: close #17462
2023-03-07 15:32:52 +08:00
7e96b06e6c [Enhance](auth)Users support multiple roles (#17236)
Describe your changes.
1.support GRANT role [, role] TO user_identity
2.support REVOKE role [, role] FROM user_identity
3.’Show grants‘ Add a column to display the roles owned by users
4.‘alter user’ prohibit deleting user's role
5.Repair Logic of roleName cannot start with RoleManager.DEFAULT_ ROLE
2023-03-07 10:28:56 +08:00
f85f89f240 [fix](planner) Fix incosistency between groupby expression and output of aggregation node (#17438) 2023-03-07 09:38:20 +08:00
440cf526c8 [fix](type compatibility) fix unsigned int type compatibility problem (#17427)
Fix unsigned int type compatibility value scope problem.

When defining columns, map UNSIGNED INT to BIGINT for compatibility.
The problems are as follows:
It is not consistent with this doc
image

We support the unsigned int type to be compatible with mysql types, but the unsigned int type is created as the int at the time of definition. This will cause numerical overflow.
2023-03-07 08:55:38 +08:00
aedbc5fcb1 [fix](planner) Slots in the cojuncts of table function node didn't got materialized #17460 2023-03-07 08:50:33 +08:00
Pxl
28c55f15c9 [Enchancement](Materialized-View) add more error infomation for select materialized view fail (#17262)
add more error infomation for select materialized view fail
2023-03-06 18:59:46 +08:00
843b4b5746 [fix](regression) Adjust the test_add_drop_index case to avoid that FE failed to start when replaying the log (#17425)
This pr is a temporary circumvention fix.

In regression case `inverted_index_p0/test_add_drop_index.groovy`, both bitmap index and inverted index are created 
on the same table, when create or drop bitmap index will change table's state to `SCHEMA_CHANGE`, create or drop
 inverted index not change the table's state.
Before do create or drop inverted index check the table's state whether is `NORMAL` or not, Because of replay log for 
'bitmap index' has change table state, and it didn't finish soon lead to table's state not change back to `NORMAL`, then
 replay log for 'inverted index' failed, FE start failed.
2023-03-06 17:39:12 +08:00
e7cba11680 [fix](array)(parquet) fix be core dump due to load from parquet file containing array types (#17298) 2023-03-06 15:18:42 +08:00
ee1be6edd7 [chore](fe) enhance_mysql_data_type (#17429) 2023-03-06 10:42:01 +08:00
155cbffe62 [fix](regression) Parameterize the S3 info for segcompaction regression (#16731) (#17391)
Use regression conf instead hard-coded S3 info.

Signed-off-by: freemandealer <freeman.zhang1992@gmail.com>
2023-03-06 10:33:22 +08:00
a8f20eb4ac [Enhencement](schema_scanner) Optimize the performance of reading information schema tables (#17371)
batch fill block
batch call rpc from FE to get table desc
For 34w colunms

SELECT COUNT( * ) FROM information_schema.columns;
time: 10.3s --> 0.4s
2023-03-06 09:53:01 +08:00
82df2ae9d8 [feature](mysql) Support secure MySQL connection to FE (#17138)
Background:
Doris currently does not support SSL connection from MySQL clients, it's not secure enough in some cases, especially access Doris via the public internet.

Solution:
- Use TLS1.2 protocol to encrypt information.
- Implementation details
  * server <--- connect <--- client
  * if enable SSL: {
  * server <--- SSL connection request packet <--- client
  * server <--- SSL Exchange ---> client } (we will add this `if` logic part in this PR)
  * server ---> handshake request packet ---> client
  * server <--- encrypted data ---> client (this part will be realized in this PR)
- reference1 https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase.html#sect_protocol_connection_phase_initial_handshake_ssl_handshake
- reference2 https://www.rfc-editor.org/rfc/rfc5246

close #16313

Signed-off-by: Yukang Lian <yukang.lian2022@gmail.com>
Co-authored-by: Gavin Chou <gavineaglechou@gmail.com>
Co-authored-by: morningman <morningman@163.com>
2023-03-04 12:14:48 +08:00
9f7386243f [Fix](regression-test)fix some unfixed-answer test #17408 2023-03-04 12:13:41 +08:00
9aecd517b0 [test](Nereids) turn on all test in scalar function w (#17269)
turn on all test case in scalar function W except width_bucket(fix be bug in next PR)
turn off all test case for group_concat(distinct order by)
fix return nullable in TimestampArithmetic
2023-03-04 08:23:50 +08:00
5c265d8183 [fix](vec)crashing caused by parallel output file (#17384) 2023-03-03 19:03:53 +08:00
9f97cd029f [Feature] (Nereids) add check to disable unsupported type (#17196)
1. disable decimalv3
2. disable json
3. disable complex type: array, map, struct
4. disable switch: group_by_and_having_use_alias
2023-03-03 17:57:48 +08:00
Pxl
ae689c3a0b [Bug](regression-test) remove some exception title on regression case (#17374)
remove some exception title on regression case
2023-03-03 14:18:10 +08:00
e82b827bc8 [optimize](vectorization)Optimize to_string's performance. (#17076) 2023-03-03 10:35:59 +08:00
f5232e5c01 [vectorized](bug) fix some open enable_fold_constant_by_be failed cases (#17240) 2023-03-03 10:30:20 +08:00
ba82cd10c6 [Enhencement](Jdbc catalog) Add two optional properties for jdbc catalog (#17245)
1. The first property is `only_specified_database`:
In the past, `Jdbc Catalog` will synchronize all database from source database.
Now we add a parameter called `only_specified_database` to jdbc catalog to allow only the specified database to be synchronized, eg:

```sql
create resource if not exists ${resource_name} properties(
    "type"="jdbc",
    "user"="root",
    "password"="123456",
    "jdbc_url" = "jdbc:mysql://172.18.0.1:${mysql_port}/doris_test?useSSL=false",
    "driver_url" = "https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/jdbc_driver/mysql-connector-java-8.0.25.jar",
    "driver_class" = "com.mysql.cj.jdbc.Driver",
    "only_specified_database" = "true"
);
```
if `only_specified_database` is `true`, jdbc catalog will only synchronize the database which is specified in `jdbc_url`.

2. The second property is `lower_case_table_names`:
This property will synchronize jdbc external data source table names in lower case.

```sql
create resource if not exists ${resource_name} properties(
  "type"="jdbc",
  "user"="doris_test",
  "password"="123456",
  "jdbc_url" = "jdbc:oracle:thin:@172.18.0.1:${oracle_port}:${SID}",
  "driver_url" = "https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/jdbc_driver/ojdbc8.jar",
  "driver_class" = "oracle.jdbc.driver.OracleDriver",
  "lower_case_table_names" = "true"
);
```
2023-03-03 00:47:46 +08:00
22983fc813 [fix](test) regression test file has been removed (#17332)
Data file in https://github.com/apache/doris/pull/16342/files has been removed for path conflict,
so change the resource path.
2023-03-03 00:44:48 +08:00
3eeeff09fd [enhancement](nereids) convert string literal to commontype in in-expr and cass-when-expr (#17200) 2023-03-02 22:05:35 +08:00
27352afdf6 [fix](fe)support multi distinct group_concat (#17237)
* [fix](fe)support multi distinct group_concat

* update based on comments
2023-03-02 17:53:13 +08:00
33349e1457 [fix](Nereids) fold 'version()' function (#17172)
For compatibility with legacy planner, we fold version() with GlobalVariable.version in Nereids
2023-03-02 17:35:41 +08:00
39f59f554a [improvement](dry-run)(tvf) support csv schema in tvf and add "dry_run_query" variable (#16983)
This CL mainly changes:

Support specifying csv schema manually in s3/hdfs table valued function

s3 (
'URI' = 'https://bucket1/inventory.dat',
'ACCESS_KEY'= 'ak',
'SECRET_KEY' = 'sk',
'FORMAT' = 'csv',
'column_separator' = '|',
'csv_schema' = 'k1:int;k2:int;k3:int;k4:decimal(38,10)',
'use_path_style'='true'
)
Add new session variable dry_run_query

If set to true, the real query result will not be returned, instead, it will only return the number of returned rows.

mysql> select * from bigtable;
+--------------+
| ReturnedRows |
+--------------+
| 10000000     |
+--------------+
This can avoid large result set transmission time and focus on real execution time of query engine.
For debug and analysis purpose.
2023-03-02 16:51:27 +08:00
9f088f6e90 [feature](json) add json_valid function (#17247)
add json_valid function

Signed-off-by: nextdreamblue <zxw520blue1@163.com>
2023-03-02 14:08:52 +08:00
9155d8b9d1 [fix](delete) fix 'is null' or 'is not null' delete predicate will get wrong result (#17190)
fix 'is null' or 'is not null' delete predicate will get wrong result

Signed-off-by: nextdreamblue <zxw520blue1@163.com>
2023-03-02 14:05:44 +08:00
707f814fc2 [fix](inverted index) fix still execute match query after drop inverted index (#17293)
background:
At the moment, match query must with inverted index,

problem description:
After drop inverted index which is the only index in table, there still can use match query for this index column.

fix it:
The index should be updated on BE regardless of whether the indexes_desc from FE is empty.
2023-03-02 11:12:54 +08:00
30df268c1f [fix](hdfs)(catalog) fix BE crash when hdfs-site.xml not exist in be/conf and fix compute node logic (#17244)
We set LIBHDFS3_CONF env in start_be.sh, so libhdfs3 will try to read this hdfs-site.xml,
if file does not exist, it will throw error. But Doris does not handle this error, cause BE crash.
This CL mainly changes:

Modify start_be.sh to only set LIBHDFS3_CONF if hdfs-site.xml exist.
Refactor the HDFSCommonBuilder so that it can return error correctly.
Add BE IP info in status, so that we can get ip from error msg like:
ERROR 1105 (HY000): errCode = 2, detailMessage = [INTERNAL_ERROR]failed to init reader for file  000.snappy.orc, err: 
[INTERNAL_ERROR][172.21.0.101]failed to init HDFSCommonBuilder, please check check be/conf/hdfs-site.xml
The logic of prefer compute node is wrong, which causing the external table query can only assign up to 3 backends.
This CL refactor this logic and also change some FE config:

prefer_compute_node_for_external_table

If set to true, query on external table will prefer to assign to compute node.
And the max number of compute node is controlled by min_backend_num_for_external_table.
If set to false, query on external table will assign to any node.

min_backend_num_for_external_table

Only take effect when prefer_compute_node_for_external_table is true.
If the compute node number is less than this value, query on external table will try to get some mix node
to assign, to let the total number of node reach this value.
If the compute node number is larger than this value, query on external table will assign to compute node only.
2023-03-02 11:09:55 +08:00
a5ae3072e5 [fix](planner) ignore aux expr when do push agg op (#17239) 2023-03-02 10:44:40 +08:00
543539cf18 [Feature](multi catalog)(nereids)Support ES external table for new planner. (#17290)
Support ES external table query using Nereids planner.
2023-03-01 22:32:41 +08:00
722755efe9 [fix](planner) change back legacy planner type coercion (#17070)
revert legacy planner change in #16844
2023-03-01 20:55:56 +08:00
b839353c2d [fix](inverted index) fix BE coredump because of not ignore case ensitivity for column name when create index (#17276) 2023-03-01 19:32:39 +08:00
b8d8cf1ac9 [regression](test) script for teamcity to check if pr need run build (#16937)
* [regression](test) script for teamcity to check if pr need run build

* Update check-pr-if-need-run-build.sh

fix

* Update check-pr-if-need-run-build.sh

fix

---------

Co-authored-by: stephen <hello_stephen@@qq.com>
2023-03-01 15:59:31 +08:00
0732eb54bc [feature](struct-type) support csv format stream load for struct type (#17143)
Refactor from_string method in data_type_struct.cpp to support csv format stream load for struct type.
2023-03-01 15:48:48 +08:00
Pxl
62440f3140 [Bug](Materialized-View) forbiden mv rewrite on create view and remove duplicate method getIsM… (#17194)
1. forbiden mv rewrite on create view to avoid select fail
2. remove duplicate method getIsMaterialized
2023-03-01 13:46:56 +08:00
b8ebcdff78 [Bug](bloomfilter) Fix wrong result using bloomfilter with date type (#17225) 2023-03-01 12:29:20 +08:00
979cf42d7a [Bug](decimalv3) Use correct decimal scale for function round (#17232)
Co-authored-by: maochongxin <maochongxin@gmail.com>
2023-03-01 12:28:41 +08:00
62ec74f4e7 segcompaction featuring verticalcompaction (#16731)
This patchset applies the following changes:

using vertical compaction machanism to do segcompaction
basic (WIP) refraction to separate segcompaction logic from BetaRowsetWriter
add segcompaction specific ut and regression tests
2023-03-01 10:55:40 +08:00
774f66c6bc [Enhencement](test) enhencement regression test of java udf (#17251)
when run regression test of java udf many times.
if failed in some reason, the next time will meet error like: function already exist

Issue Number: close #xxx
2023-03-01 09:34:40 +08:00
e687f3badd Revert "[feature-wip](BE http)Support BE http service using brpc (#16123)" (#17219)
This reverts commit 049ecccc578802496e5421db19e21e7eb256699d.
Merge back after streamload is handled.
2023-03-01 09:18:25 +08:00
1b58f7f2ea [fix](Nereids) json object and json array should always not nullable (#17205) 2023-02-28 20:26:21 +08:00
9bcc3ae283 [Fix](DOE)Fix be core dump when parse es epoch_millis date format (#17100) 2023-02-28 20:09:35 +08:00
94cea0ea6d [fix](Nereids) Disable preagg when there is DELETE_SIGN filter (#17157)
1. disable preAgg when there is delete sign when binding relation
2. keep the preAgg status in SelectMaterializeIndex rule
2023-02-28 19:59:05 +08:00
1ced23018e [improvement](test) modify test_clean_label test to support run multiple time (#17223)
use uuid in load label to avoid Label already used issue on the second run
Only for master, already fixed in branch-1.2-lts
2023-02-28 19:24:55 +08:00
34813bae13 [improvement](meta) make database,table,column names to support unicode (replace PR #13467 with this) (#14531)
Make database, table, column and other names support unicode by changing LABEL_REGEX COMMON_NAME_REGIEX COMMON_TABLE_NAME_REGEX COLUMN_NAME_REGEX regular expressions in class FeNameFormat.

P.S. @SharpRay has transfered PR #13467 to me, and I‘m responsible for the task now. There will be some modifications during the review period, so I create a new PR and the original #13467 could be closed. Thanks.
2023-02-28 18:50:36 +08:00
727853017c [regression-test](Nereids) add agg function, tvf, generator, window function test cases (#16824)
add agg_function, tvf, generator, window_function test for nereids and add more feature to gen.py
2023-02-28 17:51:39 +08:00
1dd2a41e38 [vectorized](bug) fix window function can't handle first row of beyond (#17084)
Issue Number: close #16845
2023-02-28 17:30:23 +08:00
9db56201a6 [refactor](Nereids) Refactor rewrite framework to speed up plan (#17126)
This pr refactor the rewrite framework from memo to plan tree, and speed up the analyze/rewrite stage.

Changes:
- abandoned memo in the analysis/rewrite stage, so that we can skip some actions, like new GroupExpression, distinct GroupExpression in the memo(high cost), update children to GroupPlan
- change the most of rules to static rule, so that we can skip initialize lots of rules in Analyzer/Rewriter at every query. but some rules need context, like visitor rule, create rule at the runtime make it is easy to use, so make `custom` rule can help us to create it.
- remove the `logger` field in the Job, Job are generated in large quantities at runtime, we don't need to use logger so save huge time to initialize logger.
- skip some rule as far as possible, e.g. `SelectMaterializedIndexWithoutAggregate`, skip select mv if the table not exist rullup.
- add some caches for frequent operation, like get Job.getDisableRules, Plan.getUnboundExpression
- new bottom up rewrite rule, it can keep traverse multiple new plan which return by rules, this feature depends on `Plan.mutableState`, it is necessary to add this variable field for plan. if the plan is fully immutable, we must use withXxx to renew the plan and set the state for it, this take more runtime overhead and developing workload. another reason is we need multiple mutable state, e.g. whether is applied the rule,  whether this plan is manage by the rewrite framework. the good side of mutable state is efficient, but I suggest we don't direct use mutable state in the rule as far as possible, if we need use it, please wrap the mutable state in the framework to update and release it correctly. a good example is `AppliedAwareRuleCondition`, it can update and get the state: whether this plan is applied to a rule before.
- merge some rules, invoke multiple rules in one traverse
- refactor the `EliminateUnnecessaryProject` by CustomRewritor, fix the problem which eliminate some Project which decided the query output order, the case is limit(project), sort(project).

TODO: add trace for new rewrite framework

benchmark:

legacy optimizer:
```
+-----------+---------------+---------------+---------------+
|  SQL ID   |      avg      |      min      |      max      |
+-----------+---------------+---------------+---------------+
|  SQL 1    |       1.39 ms |          0 ms |          9 ms |
|  SQL 2    |       1.38 ms |          0 ms |         10 ms |
|  SQL 3    |       2.05 ms |          1 ms |         18 ms |
|  SQL 4    |       0.89 ms |          0 ms |          9 ms |
|  SQL 5    |       1.74 ms |          1 ms |         11 ms |
|  SQL 6    |       2.00 ms |          1 ms |         13 ms |
|  SQL 7    |       1.83 ms |          1 ms |         15 ms |
|  SQL 8    |       0.92 ms |          0 ms |          7 ms |
|  SQL 9    |       2.60 ms |          1 ms |         19 ms |
|  SQL 10   |       3.54 ms |          2 ms |         28 ms |
|  SQL 11   |       3.04 ms |          1 ms |         18 ms |
|  SQL 12   |       3.26 ms |          2 ms |         16 ms |
|  SQL 13   |       1.10 ms |          0 ms |         10 ms |
|  SQL 14   |       2.90 ms |          1 ms |         13 ms |
|  SQL 15   |       1.18 ms |          0 ms |          9 ms |
|  SQL 16   |       1.05 ms |          0 ms |         13 ms |
|  SQL 17   |       1.03 ms |          0 ms |          7 ms |
|  SQL 18   |       0.94 ms |          0 ms |          7 ms |
|  SQL 19   |       1.47 ms |          0 ms |         13 ms |
|  SQL 20   |       0.47 ms |          0 ms |          4 ms |
|  SQL 21   |       0.54 ms |          0 ms |          5 ms |
|  SQL 22   |       3.34 ms |          1 ms |         19 ms |
|  SQL 23   |       7.97 ms |          4 ms |         44 ms |
|  SQL 24   |      11.11 ms |          7 ms |         28 ms |
|  SQL 25   |       0.98 ms |          0 ms |          8 ms |
|  SQL 26   |       0.83 ms |          0 ms |          7 ms |
|  SQL 27   |       0.93 ms |          0 ms |         16 ms |
|  SQL 28   |       2.19 ms |          1 ms |         18 ms |
|  SQL 29   |       3.23 ms |          1 ms |         20 ms |
|  SQL 30   |      59.99 ms |         51 ms |         81 ms |
|  SQL 31   |       2.65 ms |          1 ms |         18 ms |
|  SQL 32   |       2.47 ms |          1 ms |         17 ms |
|  SQL 33   |       2.30 ms |          1 ms |         16 ms |
|  SQL 34   |       0.66 ms |          0 ms |          8 ms |
|  SQL 35   |       0.63 ms |          0 ms |          6 ms |
|  SQL 36   |       2.25 ms |          1 ms |         15 ms |
|  SQL 37   |       5.97 ms |          3 ms |         20 ms |
|  SQL 38   |       5.73 ms |          3 ms |         21 ms |
|  SQL 39   |       6.32 ms |          4 ms |         23 ms |
|  SQL 40   |       8.61 ms |          5 ms |         35 ms |
|  SQL 41   |       6.29 ms |          4 ms |         28 ms |
|  SQL 42   |       6.04 ms |          4 ms |         15 ms |
|  SQL 43   |       5.81 ms |          3 ms |         16 ms |
+-----------+---------------+---------------+---------------+
| TOTAL AVG |       4.22 ms |       2.47 ms |      17.05 ms |
| TOTAL SUM |     181.62 ms |        106 ms |        733 ms |
+-----------+---------------+---------------+---------------+
```

nereids with memo rewrite framework(old):
```
+-----------+---------------+---------------+---------------+
|  SQL ID   |      avg      |      min      |      max      |
+-----------+---------------+---------------+---------------+
|  SQL 1    |       3.61 ms |          1 ms |         20 ms |
|  SQL 2    |       3.47 ms |          2 ms |         16 ms |
|  SQL 3    |       3.27 ms |          1 ms |         18 ms |
|  SQL 4    |       2.23 ms |          1 ms |         12 ms |
|  SQL 5    |       3.60 ms |          1 ms |         20 ms |
|  SQL 6    |       2.73 ms |          1 ms |         17 ms |
|  SQL 7    |       3.04 ms |          1 ms |         23 ms |
|  SQL 8    |       3.53 ms |          2 ms |         20 ms |
|  SQL 9    |       3.74 ms |          2 ms |         22 ms |
|  SQL 10   |       3.66 ms |          2 ms |         18 ms |
|  SQL 11   |       3.93 ms |          2 ms |         15 ms |
|  SQL 12   |       4.85 ms |          2 ms |         27 ms |
|  SQL 13   |       4.41 ms |          2 ms |         28 ms |
|  SQL 14   |       5.16 ms |          2 ms |         41 ms |
|  SQL 15   |       4.33 ms |          2 ms |         33 ms |
|  SQL 16   |       4.94 ms |          2 ms |         51 ms |
|  SQL 17   |       3.27 ms |          1 ms |         25 ms |
|  SQL 18   |       2.78 ms |          1 ms |         22 ms |
|  SQL 19   |       3.51 ms |          1 ms |         42 ms |
|  SQL 20   |       1.84 ms |          1 ms |         13 ms |
|  SQL 21   |       3.47 ms |          1 ms |         66 ms |
|  SQL 22   |       5.21 ms |          2 ms |         29 ms |
|  SQL 23   |       5.55 ms |          3 ms |         25 ms |
|  SQL 24   |       4.21 ms |          2 ms |         28 ms |
|  SQL 25   |       3.47 ms |          1 ms |         23 ms |
|  SQL 26   |       3.03 ms |          2 ms |         21 ms |
|  SQL 27   |       3.07 ms |          1 ms |         17 ms |
|  SQL 28   |       4.51 ms |          3 ms |         22 ms |
|  SQL 29   |       4.97 ms |          3 ms |         21 ms |
|  SQL 30   |      11.95 ms |          8 ms |         33 ms |
|  SQL 31   |       3.92 ms |          2 ms |         23 ms |
|  SQL 32   |       3.74 ms |          2 ms |         15 ms |
|  SQL 33   |       3.62 ms |          2 ms |         22 ms |
|  SQL 34   |       4.60 ms |          1 ms |         55 ms |
|  SQL 35   |       3.47 ms |          2 ms |         25 ms |
|  SQL 36   |       3.34 ms |          2 ms |         18 ms |
|  SQL 37   |       4.77 ms |          2 ms |         23 ms |
|  SQL 38   |       4.44 ms |          2 ms |         39 ms |
|  SQL 39   |       4.52 ms |          2 ms |         23 ms |
|  SQL 40   |       5.50 ms |          3 ms |         30 ms |
|  SQL 41   |       5.01 ms |          2 ms |         24 ms |
|  SQL 42   |       4.32 ms |          2 ms |         24 ms |
|  SQL 43   |       4.29 ms |          2 ms |         42 ms |
+-----------+---------------+---------------+---------------+
| TOTAL AVG |       4.11 ms |       1.91 ms |      26.30 ms |
| TOTAL SUM |     176.88 ms |         82 ms |       1131 ms |
+-----------+---------------+---------------+---------------+
```

nereids with plan tree rewrite framework(new):
```
+-----------+---------------+---------------+---------------+
|  SQL ID   |      avg      |      min      |      max      |
+-----------+---------------+---------------+---------------+
|  SQL 1    |       3.21 ms |          1 ms |         18 ms |
|  SQL 2    |       3.99 ms |          1 ms |         76 ms |
|  SQL 3    |       2.93 ms |          1 ms |         21 ms |
|  SQL 4    |       2.13 ms |          1 ms |         21 ms |
|  SQL 5    |       2.43 ms |          1 ms |         30 ms |
|  SQL 6    |       2.08 ms |          1 ms |         11 ms |
|  SQL 7    |       2.03 ms |          1 ms |         11 ms |
|  SQL 8    |       2.27 ms |          1 ms |         22 ms |
|  SQL 9    |       2.42 ms |          1 ms |         16 ms |
|  SQL 10   |       2.65 ms |          1 ms |         14 ms |
|  SQL 11   |       2.78 ms |          1 ms |         14 ms |
|  SQL 12   |       3.09 ms |          1 ms |         19 ms |
|  SQL 13   |       2.33 ms |          1 ms |         13 ms |
|  SQL 14   |       2.66 ms |          1 ms |         16 ms |
|  SQL 15   |       2.34 ms |          1 ms |         15 ms |
|  SQL 16   |       2.04 ms |          1 ms |         30 ms |
|  SQL 17   |       2.09 ms |          1 ms |         17 ms |
|  SQL 18   |       1.87 ms |          1 ms |         15 ms |
|  SQL 19   |       2.21 ms |          1 ms |         50 ms |
|  SQL 20   |       1.32 ms |          0 ms |         12 ms |
|  SQL 21   |       1.63 ms |          1 ms |         11 ms |
|  SQL 22   |       2.75 ms |          1 ms |         30 ms |
|  SQL 23   |       3.44 ms |          2 ms |         17 ms |
|  SQL 24   |       2.01 ms |          1 ms |         14 ms |
|  SQL 25   |       1.58 ms |          1 ms |         11 ms |
|  SQL 26   |       1.53 ms |          0 ms |         13 ms |
|  SQL 27   |       1.62 ms |          1 ms |         12 ms |
|  SQL 28   |       2.90 ms |          1 ms |         21 ms |
|  SQL 29   |       3.04 ms |          2 ms |         17 ms |
|  SQL 30   |      10.54 ms |          7 ms |         49 ms |
|  SQL 31   |       2.61 ms |          1 ms |         21 ms |
|  SQL 32   |       2.42 ms |          1 ms |         14 ms |
|  SQL 33   |       2.13 ms |          1 ms |         14 ms |
|  SQL 34   |       1.69 ms |          1 ms |         14 ms |
|  SQL 35   |       1.87 ms |          1 ms |         15 ms |
|  SQL 36   |       2.37 ms |          1 ms |         21 ms |
|  SQL 37   |       3.06 ms |          1 ms |         15 ms |
|  SQL 38   |       4.09 ms |          1 ms |         31 ms |
|  SQL 39   |       5.81 ms |          2 ms |         43 ms |
|  SQL 40   |       4.55 ms |          2 ms |         34 ms |
|  SQL 41   |       3.49 ms |          1 ms |         20 ms |
|  SQL 42   |       2.75 ms |          1 ms |         26 ms |
|  SQL 43   |       2.81 ms |          1 ms |         14 ms |
+-----------+---------------+---------------+---------------+
| TOTAL AVG |       2.78 ms |       1.19 ms |      21.35 ms |
| TOTAL SUM |     119.56 ms |         51 ms |        918 ms |
+-----------+---------------+---------------+---------------+
```
2023-02-28 16:02:09 +08:00
3e40467ce6 [Bug](vec) Fix chinese pinyin order by (#17152)
bug: some chinese word not sort by pinyin in GBK coding

CREATE TABLE `test_convert` (
                 `a` varchar(100) NULL
             ) ENGINE=OLAP
               DUPLICATE KEY(`a`)
               DISTRIBUTED BY HASH(`a`) BUCKETS 3
               PROPERTIES (
               "replication_allocation" = "tag.location.default: 1"
               );
insert into test_convert values("b"), ("a"), ("c"), ("睿"), ("多"), ("丝");
Query OK, 6 rows affected (0.03 sec)
{'label':'insert_ca73a6acc2194d5b_888218a3949355a6', 'status':'VISIBLE', 'txnId':'18068'}
mysql [test]>select * from test_convert;
+------+
| a    |
+------+
| a    |
| c    |
| 丝   |
| b    |
| 多   |
| 睿   |
+------+
6 rows in set (0.01 sec)
mysql [test]>select * from test_convert order by convert(a using gbk);          
+------+
| a    |
+------+
| a    |
| b    |
| c    |
| 多   |
| 丝   |
| 睿   |
+------+
6 rows in set (0.01 sec)
2023-02-28 14:29:56 +08:00