Commit Graph

3938 Commits

Author SHA1 Message Date
05c5ab5490 [fix](planner) only table name should convert to lowercase when create table (#17373)
we met error: Unknown column '{}DORIS_DELETE_SIGN{}' in 'default_cluster:db.table.
that because when we use alias as the tableName to construct a Table, all parts of the name will be lowercase if lowerCaseTableNames = 1.
To avoid it, we should extract tableName from alias and only lower tableName
2023-03-07 14:41:35 +08:00
b9bb28f22c [Enhancement](Planner)fix unclear exception msg when create table. #17473 2023-03-07 13:38:20 +08:00
357d8c1746 [enhance](Nereids): remove rule flag in LogicalJoin (#17452) 2023-03-07 13:18:50 +08:00
b8c9875adb [refactor](Nereids): refactor PushdownLimit (#17355) 2023-03-07 12:04:20 +08:00
b0e3156f51 [enhance](Nereids): refactor code in Project (#17450) 2023-03-07 11:15:33 +08:00
f79b066790 [fix](resource)Add s3 checker for alter resource (#17467)
* add s3 validity checker for alter resource.

* add s3 validity checker for alter resource.

* add s3 validity checker for alter resource.
2023-03-07 11:07:15 +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
bada731390 [fix](restore) fix bug when replay restore and reserve dynamic partition (#17326)
when replay restore a table with reserve_dynamic_partition_enable=true,
must registerOrRemoveDynamicPartitionTable with isReplay=true, or maybe cause
OBSERVER can not replay restore auditlog success.
2023-03-07 10:13:08 +08:00
f85f89f240 [fix](planner) Fix incosistency between groupby expression and output of aggregation node (#17438) 2023-03-07 09:38:20 +08:00
50bf02024a [Improvement](meta) support return total statistics of all databases for command show proc '/jobs (#17342)
currently, show proc jobs command can only used on a specific database,
if a user want to see overall data of the whole cluster, he has to look into every database and sum them up,
it's troublesome.
now he can achieve it simply by giving a -1 as dbId.

mysql> show proc '/jobs/-1';
+---------------+---------+---------+----------+-----------+-------+
| JobType | Pending | Running | Finished | Cancelled | Total |
+---------------+---------+---------+----------+-----------+-------+
| load | 0 | 0 | 0 | 2 | 2 |
| delete | 0 | 0 | 0 | 0 | 0 |
| rollup | 0 | 0 | 1 | 0 | 1 |
| schema_change | 0 | 0 | 2 | 0 | 2 |
| export | 0 | 0 | 0 | 3 | 3 |
+---------------+---------+---------+----------+-----------+-------+

mysql> show proc '/jobs/-1/rollup';
+----------+------------------+---------------------+---------------------+------------------+-----------------+----------+---------------+----------+------+----------+---------+
| JobId | TableName | CreateTime | FinishTime | BaseIndexName | RollupIndexName | RollupId | TransactionId | State | Msg | Progress | Timeout |
+----------+------------------+---------------------+---------------------+------------------+-----------------+----------+---------------+----------+------+----------+---------+
| 17826065 | order_detail | 2023-02-23 04:21:01 | 2023-02-23 04:21:22 | order_detail | rp1 | 17826066 | 6009 | FINISHED | | NULL | 2592000 |
+----------+------------------+---------------------+---------------------+------------------+-----------------+----------+---------------+----------+------+----------+---------+
1 row in set (0.01 sec)
2023-03-07 08:57:55 +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
b68001aee5 [fix](priv) fix duplicated priv check when check column priv (#17446)
when executing select stmt, columns privilege check will be invoked multiple times(column number in select stmt)

Issue Number: close #xxx
2023-03-07 08:51:55 +08:00
48c2d806d7 [enhencement](jdbc catalog) Use Druid instead of HikariCP in JdbcClient (#17395)
This pr does three things:
1. Use Druid instead of HikariCP in JdbcClient
2. when download udf jar, add the name of the jar package after the local file name.
3. refactor some jdbcResource code
2023-03-07 08:51:10 +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
dca16796ad [fix](ParquetReader) definition level of repeated parent is wrong (#17337)
Fix three bugs:
1.  `repeated_parent_def_level ` should be the definition of its repeated parent.
2. Failed to parse schema like `decimal(p, s)`
3. Fill wrong offsets for array type
2023-03-06 18:15:57 +08:00
0ad638f9fe [enhancement](transaction) Reduce hold writeLock time for DatabaseTransactionMgr to clear transaction (#17414)
* [enhancement](transaction) Reduce hold writeLock time for DatabaseTransactionMgr to clear transaction

* fix ut

* remove unnessary field for remove txn bdbje log

---------

Co-authored-by: caiconghui1 <caiconghui1@jd.com>
2023-03-06 11:32:21 +08:00
56a3ead2d7 [Improvement](restore) make timeout of restore job's dispatching task progress configuable (#17434)
when a restore job which has a plenty of replicas, it may fail due to timeout. The error message is:
[RestoreJob.checkAndPrepareMeta():782] begin to send create replica tasks to BE for restore. total 381344 tasks. timeout: 600000

Currently, the max value of timeout is fixed, it's not suitable for such cases.
2023-03-06 10:05:31 +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
d8a231f340 [Improvement](auth)(step-2) add ranger authorizer for hms catalog (#17424) 2023-03-05 21:50:44 +08:00
afb5def385 [enhancement](timeout) replace query timeout with exec timeout (#17360) 2023-03-05 11:03:59 +08:00
627b5ee302 [enhancement](k8s) Support fqdn mode for fe in k8s enviroment (#17329) 2023-03-05 10:18:56 +08:00
b9b028099d [enhancement](stream load pipe) using queryid or load id to identify stream load pipe instead of fragment instance id (#17362)
* [enhancement](stream load pipe) using queryid or load id to identify stream load pipe instead of fragment instance id

NewLoadStreamMgr already has pipe and other info. Do not need save the pipe into fragment state. and FragmentState should be more clear.

But this pr will change the behaviour of BE.
I will pick the pr to doris 1.2.3 and add the load id to FE support. The user could upgrade from 1.2.3 to 2.x
Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-03-04 16:19:36 +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
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
eea0cbec74 [enhancement](transaction) Reduce hold writeLock time for DatabaseTransactionMgr to improve stability of stream load (#17380)
Clear transaction state log occupies too much time, so we change clear transaction log level from info to debug


Co-authored-by: caiconghui1 <caiconghui1@jd.com>
2023-03-03 19:06:39 +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
b5b595519a [fix](log) use logger to replace printStackTrace() (#17382)
Use Logger to replace printStackTrace to better locate problems.
2023-03-03 14:51:30 +08:00
cc5fa509ad [fix](cooldown) Fix bug in concurrent update_cooldown_conf and operations that update cooldowned data (#17086) 2023-03-03 14:36:58 +08:00
f5d958ccf9 [fix](MTMV) Reset insert timeout in handleInsert (#17249)
In #16343, we split the timeout variable into two ones (one is for query and another is for insertion).

The function `ConnectProcessor::handleQuery` uses the corresponding session variable to change the timeout for the queries requested by MySQL client. However, the function `StmtExecutor::handleInsert` doesn't use the session variable to change the timeout, so we can't change the timeout for the CTAS and MTMV insertion job.
2023-03-03 11:32:50 +08:00
f5232e5c01 [vectorized](bug) fix some open enable_fold_constant_by_be failed cases (#17240) 2023-03-03 10:30:20 +08:00
449f2953c9 [Improvement](auth)(step-1) add ranger authorizer for hms catalog (#17153) 2023-03-03 09:45:08 +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
3eeeff09fd [enhancement](nereids) convert string literal to commontype in in-expr and cass-when-expr (#17200) 2023-03-02 22:05:35 +08:00
93d2d461b4 [feature](Nereids): pushdown complex project through left semi/anti Join. (#17186) 2023-03-02 21:41:08 +08:00
a1399043fe [fix](Nereids) fold constant on BE could not process alias (#17259)
1. could not use static INSTANCE for FoldConstantOnBE rule, because it is stateful
2. if expression root is Alias, should use its child to do const collection
2023-03-02 19:16:23 +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
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
4682b4564c [enhance](Nereids): delete output in olapscan toString() (#17288) 2023-03-02 10:53:24 +08:00
a5ae3072e5 [fix](planner) ignore aux expr when do push agg op (#17239) 2023-03-02 10:44:40 +08:00
201cf9c8df Revert "[enhancement](k8s) Support fqdn mode for fe in k8s enviroment (#16315)" (#17278)
This reverts commit 48afd77e37d63e2989cd85ab12b39a273fcd284e.
There is meta problem
2023-03-02 00:44:54 +08:00
bb88f2ec7d [fix](multi-catalog) fix not find dbname from internal catalog (#17119)
Signed-off-by: nextdreamblue <zxw520blue1@163.com>
fix not find dbname from internal catalog
2023-03-01 23:59:12 +08:00
b0c5250bf9 [Enhancement](tvf) support trim_double_quotes and skip_lines for S3 and HDFS table valued function (#17224)
support trim_double_quotes and skip_lines for S3 and HDFS table valued function
2023-03-01 23:41:31 +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
6b70faa638 [fix](planner) should call Expr's unwrapSlotRef instead of getSrcSlotRef o prevent null pointer (#17265) 2023-03-01 20:07:36 +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
d44c4b1300 [improvement][fix](catalog) check required properties when creating catalog and fix jdbc catalog issue (#17209)
Check required properties when creating catalog.
To avoid some strange error when missing required properties

This PR add checks for:

hms catalog: check the validation of dfs.ha properties

jdbc catalog: check jdbc_url, driver_url, driver_class is set.

Fix NPE when init MasterCatalogExecutor
The MasterCatalogExecutor may be called by FrontendServiceImpl from BE, which does not have ConnectionContext.

Add more jdbc url param to resolve Chinese issue

add useUnicode=true&characterEncoding=utf-8 by default in jdbc catalog when connecting to MySQL

Update FAQ doc of catalog
2023-03-01 17:08:36 +08:00