Commit Graph

8276 Commits

Author SHA1 Message Date
181aadd5d3 [fix](information_schema) fix messy code of CHECK_TIME column of informatio_schema.tables (#14915) 2022-12-10 18:45:25 +08:00
6f9afbd74f [fix](Nereids): just allow crossjoin empty condition. (#14893) 2022-12-10 15:32:49 +08:00
b7453f6f09 [pipeline](mysqlsink) support mysql table sink (#14982) 2022-12-10 13:16:53 +08:00
68092fe514 [pipeline](NLJ) support nested loop join for pipeline (#14966) 2022-12-10 00:20:16 +08:00
ef1bb9819a [feature-wip](MTMV) Support mapping the partition rule of base table to the materialized view (#14930)
When we create a materialized view for multiple tables, users may not figure out the partition rule for the materialized view, because the query result can be too complex. If the query result doesn't match one of the partition rules, the insertion will fail.

We can resolve this issue by mapping the partition rule of base table to the materialized view. As a result, users don't need specify the partition rules and query results are all valid because they are retrieved from the partitions of the base table.

## Use case

mysql> CREATE TABLE t1 (pk INT NOT NULL, v1 INT SUM) PARTITION BY RANGE(pk) (
    ->   PARTITION p1 VALUES LESS THAN ('10'),
    ->   PARTITION p2 VALUES LESS THAN ('90')
    -> )
    -> DISTRIBUTED BY HASH(pk)
    -> PROPERTIES ('replication_num' = '1');
Query OK, 0 rows affected (0.04 sec)

mysql> CREATE TABLE t2 (pk INT NOT NULL, v2 INT SUM) PARTITION BY LIST(pk) (
    ->   PARTITION odd VALUES IN ('10', '30', '50', '70', '90'),
    ->   PARTITION even VALUES IN ('20', '40', '60', '80')
    -> )
    -> DISTRIBUTED BY HASH(pk)
    -> PROPERTIES ('replication_num' = '1');
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE MATERIALIZED VIEW mv BUILD IMMEDIATE REFRESH COMPLETE
    -> KEY (mpk) PARTITION BY (t1.pk) DISTRIBUTED BY HASH(mpk) PROPERTIES ('replication_num' = '1')
    -> AS SELECT t1.pk AS mpk, v1, v2 FROM t1, t2 WHERE t1.pk = t2.pk;
Query OK, 0 rows affected (0.10 sec)

mysql> SHOW CREATE TABLE mv;
+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Materialized View | Create Materialized View                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mv                | CREATE MATERIALIZED VIEW `mv`
BUILD IMMEDIATE REFRESH COMPLETE ON DEMAND
KEY(`mpk`)
PARTITION BY RANGE(`mpk`)
(PARTITION p1 VALUES [("-2147483648"), ("10")),
PARTITION p2 VALUES [("10"), ("90")))
DISTRIBUTED BY HASH(`mpk`) BUCKETS 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2",
"disable_auto_compaction" = "false"
)
AS SELECT `t1`.`pk` AS `mpk`, `v1` AS `v1`, `v2` AS `v2` FROM `default_cluster:dev`.`t1` , `default_cluster:dev`.`t2` WHERE `t1`.`pk` = `t2`.`pk`; |
+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
2022-12-09 22:47:21 +08:00
wxy
af50461211 [fix](statistics) fix CpuTimeMS in audit log when enable_vectorized_engine=true. (#14853)
Co-authored-by: wangxiangyu@360shuke.com <wangxiangyu@360shuke.com>
2022-12-09 21:13:05 +08:00
f5aa5c1d01 [fix](statistics) Fix NPE when update analysis job status #14892 2022-12-09 21:12:36 +08:00
22e9f5cc33 [typo](docs)fix the FE&BE config document (#14969) 2022-12-09 21:11:30 +08:00
9eeb8b8711 [Bugfix](Jsonb) fix jsonb load in unique key model (#14958)
* [Bugfix](Jsonb) fix jsonb load in unique key model

Register JSONB to `replace_load` agg function

* fix test
2022-12-09 21:10:14 +08:00
Pxl
4c27ee2584 [Bug](predicate) fix undefined behavior on in list predicate #14961 2022-12-09 21:09:54 +08:00
0c8fdc90fb [pipeline](union) support union operator (#14963) 2022-12-09 19:55:40 +08:00
4611947920 [Pipeline](Operator) Add schema scan node operator (#14955) 2022-12-09 19:55:03 +08:00
0ec218108d [enhancement](remote) support local cache GC at the granularity of cache files (#14920)
* [enhancement](remote) support local cache GC at the granularity of cache files

* update

* update

* update
2022-12-09 17:35:23 +08:00
8d17eea22b [pipeline](mysqlscan) support mysql scan node (#14949) 2022-12-09 16:25:29 +08:00
8c02f19302 [chore](regression) use correct bucket path in regression conf (#14960) 2022-12-09 16:20:27 +08:00
0aa32ec1af [typo](docs)optimize the BE config document (#14957) 2022-12-09 16:05:15 +08:00
9d96242242 [typo](docs)optimize the FE config document (#14899)
* optimize the FE config document
2022-12-09 16:04:49 +08:00
93b281b44b [feature](Nereids) support select except syntax (#14851)
Support syntax: select * except(v1, v2) from t;
2022-12-09 15:54:26 +08:00
b213ce6ffd [Bug](pipeline) Fix double prepare on pipeline engine (#14959) 2022-12-09 14:35:34 +08:00
873b128fde [feature](pipeline) add inersect/except operators (#14868) 2022-12-09 14:13:48 +08:00
5a1c7f6314 [improvement](analytic) improve memory counter (#14890) 2022-12-09 14:13:17 +08:00
ec24a56956 [Exec][Pipeline] Remove AggContext's lock (#14901)
* [Exec][Pipeline] Remove AggContext's lock

* fix lock location
2022-12-09 14:11:28 +08:00
9d36931038 [Refactor](NLJ) refactor the nested loop join node (#14911)
* [Refactor](NLJ) refactor the nested loop join node

* change the logic of alloc/release resource
2022-12-09 14:10:26 +08:00
dffa3c0db2 [enhancement](memory) Support query memroy overcommit #14948
Add conf enable_query_memroy_overcommit

If true, when the process does not exceed the soft mem limit, the query memory will not be limited; when the process memory exceeds the soft mem limit, the query with the largest ratio between the currently used memory and the exec_mem_limit will be canceled.

If false, cancel query when the memory used exceeds exec_mem_limit, same as before.
2022-12-09 14:09:05 +08:00
00f44257e2 [feature-wip](file-reader) Merge hdfs reader to the new file reader (#14875) 2022-12-09 13:21:59 +08:00
20f2abb3d4 [vectorized](pipeline) support assert num rows operator (#14923) 2022-12-09 09:39:29 +08:00
b311ebef6c [pipeline](refactor) do some refactor for code and comments (#14934) 2022-12-09 09:08:28 +08:00
3209e49541 [Regression](pipeline) remove ssb test for pipeline (#14953) 2022-12-09 09:08:09 +08:00
1140092211 [docs](jdbc catalog) add docs for jdbc catalog (#14924) 2022-12-09 08:57:39 +08:00
5768118bfa [Improvement](multi-catalog) add show create catalog stmt (#14938) 2022-12-09 08:56:55 +08:00
41eafa5e9d [fix](aggregate) agg table and unique table get different result when… (#14822)
Signed-off-by: nextdreamblue <zxw520blue1@163.com>
2022-12-08 22:54:36 +08:00
1fcf6475cf [improvement](multi-catalog)Support invalid/not invalid option for refresh catalog and db. (#14922)
Current refresh catalog/db operation always invalid all the related cache. In some cases, it is not necessary,
for example, create a new db in external data source. This pr is to support refresh without invalidate cache.

refresh catalog hive properties("invalid_cache" = "false");
refresh database hive.db1 properties("invalid_cache" = "false");
2022-12-08 20:38:07 +08:00
e8becaa562 [refactor](resource) unified resource user interface (#14842)
At present, there are multiple user interface to access hdfs and s3.
Each interface has its own configuration and is different, which causes confusion for users.
Create resource already supports remote storage resources and resource permission management,
but only `spark`/`odbc_catalog` are in use.
Cloud  storage resources need to be created and managed uniformly through create resource.

This PR contains the following changes:

1. Add `s3`, `hdfs` and `hms` resource, and each resource contains it's own configuration items, and delete configuration items scattered in other classes.

2. Use `resource` to create `storage` tools, and use `storage` tools to access the remote file system.
2022-12-08 20:37:10 +08:00
244bf84483 [improvement](docs) add docs for alter catalog stmt (#14789) 2022-12-08 19:46:58 +08:00
b3b493fdef [typo](docs)Java udf and Jdbc doc fix (#14927)
* java udf doc fix
2022-12-08 18:24:27 +08:00
c0b764e419 [fix](schemachange) fix the schema change that causes the be core dump. (#14804)
* [fix](schemachange) fix the schema change that causes the be core dump.

Forbid schema change to add or modify the key column of the agg model as double or float.
2022-12-08 17:36:54 +08:00
Pxl
375e0e08ca [Bug](predicate) fix ccore dump on varchar with in list predicate (#14881)
* fix ccore dump on varchar with in list predicate

* update case

* Update sqlsmith01.sql
2022-12-08 17:14:23 +08:00
562fb6db83 [fix](Nereids) event channel dead loop until queue is not empty (#14816) 2022-12-08 15:55:09 +08:00
0c817e6b3a [Pipeline](hashjoin) Support hash join on pipeline engine (#14898) 2022-12-08 15:43:02 +08:00
1887881a61 [feature](Nereids) support push down no group agg to olap scan (#14683)
use zonemap to do aggregate without group by exprs.
valid aggregate function:
- count
- min
- max

implementation in legacy planner: #12881
2022-12-08 15:34:39 +08:00
2fb896d916 [feature](nereids) Support using join syntax (#14784) 2022-12-08 15:22:41 +08:00
Pxl
dbaa02d3a0 [Pipeline](fix) fix enable_pipeline_engine variable not work (#14909) 2022-12-08 14:52:52 +08:00
4c5ddf70db [bugfix](conf) remove useless conf (#14918) 2022-12-08 14:11:15 +08:00
be3f3978c8 [enhancement](test) remove sf1DataPath conf from regression-conf.groovy (#13861) 2022-12-08 11:24:25 +08:00
e62cc2ce76 [minor](typo) Fix typo (#14903) 2022-12-08 10:50:45 +08:00
27c8147a2b [fix](multi-catalog) use last used database for catalog when switch back (#14793)
remember last used database of every catalog and use it when switch back
2022-12-08 10:32:30 +08:00
962810b973 [Vectorized](jdbc) add check type for jdbc table (#14501) 2022-12-08 10:27:47 +08:00
56cc777087 [fix] 'SHOW ROLES' statement does not display resource privilege (#14812) (#14897) 2022-12-08 10:22:09 +08:00
167a20a03b [Minor](Planner): remove redundant SessionVariable (#14818) 2022-12-08 08:33:07 +08:00
6d6de0d408 [fix](multi-catalog) check new catalog name is used or not before rename (#14891) 2022-12-07 21:54:44 +08:00