Commit Graph

5343 Commits

Author SHA1 Message Date
1706699e7e [fix](multi-catalog)support the max compute partition prune (#27154)
1. max compute partition prune,
we just support filter mc partitions by '=',it can filter just one partition
to support multiple partition filter and range operator('>','<', '>='..), the partition prune should be supported.

2. add max compute row count cache and partitionValues cache

3. add max compute regression case
2023-12-01 22:28:26 +08:00
68525fc112 [feature](profile) add RuntimeFilterInfo in merge profile #27869 2023-12-01 21:42:25 +08:00
8749e5208f [fix](jdbc catalog) fix insert into jdbc table column order (#27855) 2023-12-01 20:46:48 +08:00
1451a835b7 [fix](stats) Don't save colToPartitions anymore to save mem (#27879) 2023-12-01 19:54:30 +08:00
3f20cf1456 [fix](nereids)set operation's result type is wrong if decimal overflows (#27870) 2023-12-01 18:40:06 +08:00
26e81b6573 [fix](stats)min and max return NaN when table is empty (#27862)
fix analyze empty table and min/max null value bug:
1. Skip empty analyze task for sample analyze task. (Full analyze task already skipped).
2. Check sample rows is not 0 before calculate the scale factor.
3. Remove ' in sql template after remove base64 encoding for min/max value.
2023-12-01 17:00:56 +08:00
18338a33b6 [bugfix](mergeprofile) ignore null profile to avoid bug (#27860)
---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-12-01 16:56:29 +08:00
34c85c962f [opt](Nereids) improve semi/anti join estimation when column stats are unavailable #27793
this change improves performance of tpch q20. on sf500, improved from 6.3sec to 1.1 sec
this change has no impaction on tpcds

when column stats is unknown,
the basic algorithm to estimate left semi join output row count is its left child output row count.
q1: "A left semi join B on A.x=B.x"
the output row is estimated as A.rowCount.

But the basic algorithm is not good to following pattern:
q2: "A left semi join filter(B) on A.x=B.x"
Because there is a filter on B, usually this left semi join also reduce the row count of A, and we estimate
the output of q2 as A.rowCount * Filter.rowCount/B.rowCount
2023-12-01 15:48:33 +08:00
94b75515e5 [minor](stats) Throw error when sync analyze failed (#27845) 2023-12-01 15:44:27 +08:00
39692266d3 [minor](stats) Update olap table row count after analyze (#27814) 2023-12-01 13:51:42 +08:00
e868c990ff [feature](Nereids) support add constraint on table (#27627)
support add constraint on the table including
- primary key constraint
- unique constrain
- foreign key constraint
2023-12-01 13:28:48 +08:00
48d7df205f [chore](log) Add more detail msg for waitRPC exception #27771 2023-12-01 11:59:47 +08:00
776f0205f3 [Fix](test) Fix an auto partition conflict and add many testcases (#27730)
Fix an auto partition conflict and add many testcases
2023-12-01 09:58:44 +08:00
2afbece0b8 [Fix](type) fix wrong type transform for unix_timestamp (#27728)
fix wrong type transform for unix_timestamp
2023-12-01 09:58:20 +08:00
c1d73ecefb [chore](load) rm some load related redundant code (#27102) 2023-12-01 09:29:28 +08:00
6a614c3e7b [regression](nereids) add regression case for transposeSemiJoinAgg/transposeSemiJoinAggProject rules (#27664)
add case for transposeSemiJoinAgg/transposeSemiJoinAggProject rules
2023-12-01 08:19:16 +08:00
2b2c2dd772 [fix](sequence column) insert into should require sequence column in all scenario (#27780) 2023-11-30 23:27:58 +08:00
6c4ec3cb82 [FIX](complextype)fix array/map/struct impl hashcode and equals (#27717) 2023-11-30 22:08:15 +08:00
c93b5727b3 [fix](profile) fix double add in aggcounter #27826 2023-11-30 21:45:15 +08:00
16fb7a507c [fix](colocate) bucket index cannot be set correctly when do colocate balance (#27741)
for (Partition partition : olapTable.getPartitions()) {
    short replicationNum = replicaAlloc.getTotalReplicaNum();
    long visibleVersion = partition.getVisibleVersion();
    // Here we only get VISIBLE indexes. All other indexes are not queryable.
    // So it does not matter if tablets of other indexes are not matched.
    for (MaterializedIndex index : partition.getMaterializedIndices(IndexExtState.VISIBLE)) {
        Preconditions.checkState(backendBucketsSeq.size() == index.getTablets().size(),
                backendBucketsSeq.size() + " vs. " + index.getTablets().size());
        int idx = 0;
        for (Long tabletId : index.getTabletIdsInOrder()) {
            counter.totalTabletNum++;
            Set<Long> bucketsSeq = backendBucketsSeq.get(idx);
            Preconditions.checkState(bucketsSeq.size() == replicationNum,
                    bucketsSeq.size() + " vs. " + replicationNum);
            Tablet tablet = index.getTablet(tabletId);
            TabletStatus st = tablet.getColocateHealthStatus(
                    visibleVersion, replicaAlloc, bucketsSeq);
            if (st != TabletStatus.HEALTHY) {
                counter.unhealthyTabletNum++;
                unstableReason = String.format("get unhealthy tablet %d in colocate table."
                        + " status: %s", tablet.getId(), st);
                LOG.debug(unstableReason);

                if (!tablet.readyToBeRepaired(infoService, Priority.NORMAL)) {
                    counter.tabletNotReady++;
                    // 这里需要将  idx++ ,否则 bucketsSeq和 tablet replicas backends 对应不上
                    idx++;
                    continue;
                }

                TabletSchedCtx tabletCtx = new TabletSchedCtx(
                        TabletSchedCtx.Type.REPAIR,
                        db.getId(), tableId, partition.getId(), index.getId(), tablet.getId(),
                        replicaAlloc, System.currentTimeMillis());
                // the tablet status will be set again when being scheduled
                tabletCtx.setTabletStatus(st);
                tabletCtx.setPriority(Priority.NORMAL);
                tabletCtx.setTabletOrderIdx(idx);

                AddResult res = tabletScheduler.addTablet(tabletCtx, false /* not force */);
                if (res == AddResult.LIMIT_EXCEED || res == AddResult.DISABLED) {
                    // tablet in scheduler exceed limit, or scheduler is disabled,
                    // skip this group and check next one.
                    LOG.info("tablet scheduler return: {}. stop colocate table check", res.name());
                    break OUT;
                } else if (res == AddResult.ADDED) {
                    counter.addToSchedulerTabletNum++;
                }  else {
                    counter.tabletInScheduler++;
                }
            }
            idx++;
        }
    }
}
2023-11-30 20:28:18 +08:00
7f13dcc726 [refactor](cluster)(step-3) remove cluster related to Auth (#27718)
Remove `default_cluster` prefix related to:
1. User
2. Role
3. UserManager
4. RoleManager
5. UserRoleManager
6. UserProperty
7. Create/Drop user Stmt
8. Create/Drop role Stmt
9. Grant/Revoke
2023-11-30 12:46:08 +08:00
5739167142 [feature](window_function) support to secondary argument to ignore null values in first_value/last_value (#27623) 2023-11-30 09:56:43 +08:00
1f9aa8ab16 [fix](group commit) Fix some group commit problems (#27769) 2023-11-29 23:43:21 +08:00
d96e2dfefb [feature-wip](arrow-flight)(step5) Support JDBC and PreparedStatement and Fix Bug (#27661) 2023-11-29 21:17:20 +08:00
19ecb3a8a2 [opt](stats) Use escape rather than base64 for min/max value (#27746) 2023-11-29 21:13:33 +08:00
acc14d7e4c [feature](Planner): Push down LimitDistinct through Union (#27745) 2023-11-29 21:12:42 +08:00
83ed8d3cba [Feat](Nereids) join hint support stage one (#27378)
support view as a independent unit of leading hint
add random test check of leading hint query
add more test with data of leading hint query
add random test check of distribute hint
2023-11-29 21:08:08 +08:00
6cdaf8ea32 [bugfix](profile) insert into select profile could not build successfully(#27756)
Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-11-29 20:44:25 +08:00
d00c04ccc1 [enhancement](stats) limit bq cap size for analyze task (#27685) 2023-11-29 20:35:56 +08:00
ba6219c3c3 [fix](stats) Fix show auto analyze missing jobs bug (#27755) 2023-11-29 20:33:29 +08:00
c99eb5d80f [fix](multi-catalog)add properties converter fe ut (#27254) 2023-11-29 19:01:29 +08:00
9daa7dc6b5 [refactor](http) disable snapshot and get_log_file api (#27724)
Disable 2 http api by default:

1. BE's `/api/snapshot`
2. FE's `/get_log_file`
2023-11-29 16:11:51 +08:00
c30299cbf7 [docs](partition) Improve auto partitions document (#27662) 2023-11-29 15:08:52 +08:00
32367c6d97 [chore](checkstyle): forbid lombok in Nereids (#27700) 2023-11-29 14:06:20 +08:00
2b375f66e0 [feature](Nereids): add functional dependencies (#27051)
Add functional dependencies: including

- uniform slot, which means ndv <= 0
- unique slot, which means ndv = row cound
2023-11-29 12:46:25 +08:00
7398c3daf1 [Feature-Variant](Variant Type) support variant type query and index (#27676) 2023-11-29 10:37:28 +08:00
3bc09e55f6 [Improvement](unset_variable) add docs for unset-variable stmt and update privilege check (#27672) 2023-11-29 10:30:18 +08:00
9870817def add query queue regression test (#27613) 2023-11-29 10:00:20 +08:00
b3111e47ff [Improvement](statistics)Add config for the threshold of column count for auto analyze (#27713) 2023-11-29 09:30:26 +08:00
aa6573db4f [fix](statistics)Fix sample min max npe bug (#27702)
Min and max value may be NULL, need to handle this case in sample analyze.
2023-11-28 21:24:20 +08:00
c6f43e4241 [Fix](show-load)Show load npe(userinfo is null) (#27698) 2023-11-28 21:07:32 +08:00
1b509ab13c [Fix](statistics)Need to recalculate health value when table row count become 0 (#27673)
Need to recalculate health value when table row count become 0. Otherwise, when user truncate a table, the old statistics will not be updated.
2023-11-28 18:47:12 +08:00
7087250b4a [fix](insert) txn insert and group commit should write \N string corr… (#27637) 2023-11-28 17:32:50 +08:00
f0dbce4cf5 [fix](Nereids) compound predicate need cast children to boolean (#27649) 2023-11-28 16:55:44 +08:00
3d46643dab [feature](Nereids): rewrite count(null) to 0 (#27471)
select count(null) --> select 0
2023-11-28 16:25:34 +08:00
91f56cefc0 [feature](Nereids): Pushdown TopN-Distinct through Union (#27628)
```
  TopN-Distinct
  -> Union All
  -> child plan1
  -> child plan2
  -> child plan3
 
  rewritten to
 
  TopN-Distinct
  -> Union All
    -> TopN-Distinct
      -> child plan1
    -> TopN-Distinct
      -> child plan2
    -> TopN-Distinct
      -> child plan3
```
2023-11-28 15:23:46 +08:00
2ea1e9db44 [fix](nereids) temp partition is always pruned (#27636) 2023-11-28 14:18:14 +08:00
Pxl
31fe48111b [Improvement](materialized-view) forbidden mv rewriter when select stmt's from clause not have mv (#27638)
forbidden mv rewriter when select stmt's from clause not have mv
2023-11-28 14:11:46 +08:00
fc2129a09f [fix](stats) skip collect agg_state type (#27640) 2023-11-28 11:43:48 +08:00
f329b90696 [fix](show_variables) fix default value for special variables (#27651) 2023-11-28 11:35:46 +08:00