Commit Graph

2415 Commits

Author SHA1 Message Date
wxy
061b28b32e [Fix](profile) fix /rest/v1/query_profile action. (#15981)
Co-authored-by: wangxiangyu@360shuke.com <wangxiangyu@360shuke.com>
2023-01-17 20:21:48 +08:00
02a7995171 [fix](planner)wrong result when has order by under join (#15974) 2023-01-17 20:20:56 +08:00
38663526b7 [fix](planner) Keep type of null literal expr when register conjuncts (#15878)
For now, type information of child expr which is NullLiteral would get lost in the CastExpr#getResultValue, this will produce a NullLiteral with Null  type which cause BE core when doing cast
2023-01-17 16:48:02 +08:00
7e4bc1fee6 [fix](Nereids) add a rule to adjust nullable of all expressions (#15791)
we have some rules that change output's nullable in rewrite step. So we need a rule to adjust nullable at the end of rewrite step.

TODO
- remove the output slot map
- add nullable compare into slot reference
- use exprid to compare two slot if do not need to compare nullable
- merge all rules into one to adjust all type plans
2023-01-17 15:51:25 +08:00
82e2102e18 [fix](MTMV) Exceptions occur when dropping meterialized view with if exists (#15568) 2023-01-17 15:29:39 +08:00
d062ca2944 [refactor](vectorized) remove unnecessary vectorization check (#15984) 2023-01-17 12:21:46 +08:00
b469efdb17 [fix](Nereids) all slot in grouping sets in repeat node should be nullable (#15991)
according to be's code, all slot in grouping set should be nullable.
reference to be code (be3482e6d6/be/src/vec/exec/vrepeat_node.cpp (L113))
2023-01-17 11:47:55 +08:00
d98abb12f9 [fix](Nereids)set oepration type coercion is diff with legacy planner (#15982) 2023-01-17 11:41:41 +08:00
ce1d19b373 [fix](Nereids) lateral view cannot bind function nested in generators (#15960) 2023-01-17 11:37:56 +08:00
8d25b156aa [fix](nereids) bind slot using exactly match (#15950)
example:
unbound slot k
bounded [k, t.k]

In previous binding algorithm, there are 2 candidate bindings,
in which bounded k is exactly matched unbound slot k, it has higher priority than that of t1.k
2023-01-17 11:25:08 +08:00
b6d9e73c59 [feature](merge-on-write) enable by default (#15920) 2023-01-17 11:15:42 +08:00
1ea11aa120 [Bug](datev2) Fix wrong cast expr (#15985)
Found by regression tests when I turn on enable_date_conversion
2023-01-17 10:18:20 +08:00
4b49d05e97 [refactor](fe) remove type related class to fe-common to reduce java-udf jar size (#15808) 2023-01-17 00:01:15 +08:00
899f5f5cf5 [feature](multi-catalog) support hive metastore more events (#15702)
support hive metastore more events
2023-01-16 14:16:12 +08:00
fa03c8a241 [feature](nereids) const folding for in-predicate with null literal (#15880)
select 1 in (2 , null)  => null
select 1 in (1 , null)  => true
select 1 not in (2 , null)  => null
select 1 not in (1 , null)  => false
2023-01-16 13:48:45 +08:00
wxy
067b33bca7 [Enhancement](profile) use queryId of originStatement as the queryId. (#15898)
* [Enhancement](profile) use queryId of originStatement as the queryId.

Co-authored-by: wangxiangyu@360shuke.com <wangxiangyu@360shuke.com>
2023-01-15 18:26:14 +08:00
58c520dbfd [Feature](remote) Cooldown cold data to object storage only one replica (#15832) 2023-01-14 23:58:00 +08:00
0a57f12578 [Bug](datev2) Fix bugs for datev2 (#15860)
These bugs are found when I run regression test with enable_date_conversion on
2023-01-14 18:36:36 +08:00
313e14d220 [Bugfix] (ROLLUP) fix the coredump when add rollup by link schema change (#15654)
Because of the rollup has the same keys and the keys's order is same, BE will do linked schema change. The base tablet's segments will link to the new rollup tablet. But the unique id from the base tablet is starting from 0 and as the rollup tablet also. In this case, the unique id 4 in the base table is column 'city', but in the rollup tablet is 'cost'. It will decode the varcode page to bigint page so that be coredump. It needs to be rejected.

I think that if a rollup add by link schema change, it means this rollup is redundant. It brings no additional revenue and wastes storage space. So It needs to be rejected.
2023-01-14 10:20:07 +08:00
2810029d24 [fix](multi-catalog) fix bug that replay init catalog may happen after catalog is dropped (#15919) 2023-01-14 09:41:37 +08:00
cedbed67be [feature-wip](MTMV) Support table aliases when creating a materialized view with multiple tables (#15849)
## Use Case

mysql> CREATE TABLE t_user (
    ->   event_day DATE,
    ->   id bigint,
    ->   username varchar(20)
    -> )
    -> DISTRIBUTED BY HASH(id) BUCKETS 10
    -> PROPERTIES ('replication_num' = '1');
Query OK, 0 rows affected (0.07 sec)

mysql> CREATE TABLE t_user_pv(
    ->   event_day DATE,
    ->   id bigint,
    ->   pv bigint
    -> )
    -> DISTRIBUTED BY HASH(id) BUCKETS 10
    -> PROPERTIES ('replication_num' = '1');
Query OK, 0 rows affected (0.09 sec)

mysql> CREATE MATERIALIZED VIEW mv
    -> BUILD IMMEDIATE REFRESH COMPLETE
    -> START WITH "2022-10-27 19:35:00"
    -> NEXT 1 SECOND
    -> KEY (username)
    -> DISTRIBUTED BY HASH(username) BUCKETS 10
    -> PROPERTIES ('replication_num' = '1')
    -> AS SELECT t1.username ,t2.pv FROM t_user t1 LEFT JOIN t_user_pv t2 on t1.id = t2.id;
Query OK, 0 rows affected (0.10 sec)

mysql> DESC mv;
+----------+-------------+------+-------+---------+-------+
| Field    | Type        | Null | Key   | Default | Extra |
+----------+-------------+------+-------+---------+-------+
| username | VARCHAR(20) | Yes  | true  | NULL    |       |
| pv       | BIGINT      | Yes  | false | NULL    | NONE  |
+----------+-------------+------+-------+---------+-------+
2 rows in set (0.02 sec)
2023-01-14 01:29:32 +08:00
2580c88c1b [feature](multi-catalog) support oracle jdbc catalog (#15862) 2023-01-14 00:01:33 +08:00
bd2280b4ce [fix](planner) move join reorder to the single node planner (#15817)
Reorder in analyze phase would produce a stmt which its corresponding SQL could not be analyzed correctly and cause an analyze exception that may be happened in the stmt rewrite, since the rewriter will reset and reanalyze the rewritten stmt.
2023-01-13 19:42:12 +08:00
e979cc444a [improvement](multi-catalog) support hive 1.x (#15886)
The inferface of hive metastore changes from version to version.
Currently, Doris use hive 2.3.7 as hms client version.
When using to connect hive 1.x, some interface such as get_table_req does not exist
in hive 1.x. So we can't get metadata from hive 1.x.

In this PR, I copied the HiveMetastoreClient from hive 2.3.7 release, and modify some of interface's
implementation, so that it will use old interface to connect to hive 1.x.

And when creating hms catalog, you can specify the hive version, eg:

CREATE CATALOG `hive` PROPERTIES (
  "hive.metastore.uris" = "thrift://127.0.0.1:9083",
  "type" = "hms",
  "hive.version" = "1.1"
);
If hive.version does not specified, Doris will use hive 2.3.x compatible interface to visit hms.
2023-01-13 18:32:12 +08:00
a8dacfbfd9 [opt](planner) return bigint literal when cast date literal to bigint type (#15613) 2023-01-13 12:58:04 +08:00
c1963e799a [fix](nereids)upgrade signature datatype bug (#15867)
ComputeSignatureHelper.upgradeDateOrDateTimeToV2()
we upgrate return date type, but forget to upgrade arguments datatype.

The same problem in upgradeDecimalV2ToV3()
2023-01-13 12:54:25 +08:00
67378a2dc3 [fix](nereids) fix bug in SequenceFunction legality check (#15812)
1. fix bug in sequence_match function
2. do type promotion instead of explicit cast for
  - varcharLiteral -> stringLiteral
  - charLiteral->stringLiteral
2023-01-13 12:09:53 +08:00
688a0bb96a [feature](multi-catalog) support clickhouse jdbc catalog (#15780) 2023-01-13 10:07:22 +08:00
a7af869bfd [opt](Nereids) group_concat to support more cases (#15815)
enhance group_concat to support group_concat(cast(slot), ...) and support call it with 1 argument.
2023-01-13 00:41:13 +08:00
9d41994c17 [opt](Nereids) throw exception when aliasedQuery has no alias(#15854) 2023-01-13 00:35:16 +08:00
d23646793c [fix](nereids) binding group by key on agg.output if output is slot (#15623)
case 1
`select count(1) from t1 join t2 on t1.a = t2.a group by a`
`group by a` is ambiguous

case 2
`select t1.a from t1 join t2 on t1.a = t2.a group by a`
`group by a` is bound on t1.a
2023-01-12 16:34:56 +08:00
39697bb83e [fix](Nereids) make the type of the first parameter in window_funnel is intergerLike (#15810) 2023-01-12 11:53:28 +08:00
ea0ef0d880 [fix](session-variable) repeat_max_num should be forwarded (#15840)
repeat_max_num should be forwarded to master, or stmt like:
insert into tbl values(repeat("a", 1000)) will not be affected by this session variable.
2023-01-12 10:51:35 +08:00
88a2088c1d [feature](Nereids) parse pipe_concat symbol as concat when sql mode set to PIPES_AS_CONCAT (#15775) 2023-01-11 21:41:14 +08:00
ea1493d946 [fix](Nereids) can not parse left and right function (#15655) 2023-01-11 21:29:32 +08:00
330ed9a84c [fix](Nereids) toSql is not work well in non-query statement (#15752) 2023-01-11 18:56:55 +08:00
cfb110c905 [fix](nereids) fix some nereids bugs (#15714)
1. remove forcing nullable for slot on EmptySetNode.
2. order by xxx desc should use nulls last as default order.
3. don't create runtime filter if runtime filter mode is OFF.
4. group by constant value need check the corresponding expr shouldn't have any aggregation functions.
5. fix two left outer join reorder bug( A left join B left join C).
6. fix semi join and left outer join reorder bug.( A left join B semi join C ).
7. fix group by NULL bug.
8. change ceil and floor function to correct signature.
9. add literal comparasion for string and date type.
10. fix the getOnClauseUsedSlots method may not return valid value.
11. the tightness common type of string and date should be date.
12. the nullability of set operation node's result exprs is not set correctly.
13. Sort node should remove redundent ordering exprs.
2023-01-11 17:18:44 +08:00
d4e4e18b47 [fix](DOE): Fix query _id error and es properties error (#15792)
Fix query _id error
_id not exist mapping, but be can query it, we need skip check it exist mapping.
2023-01-11 17:00:59 +08:00
18a3b75626 [fix](QueryDetail) fix QueryDetail may be incorrect and null pointer exception (#15765)
* [fix](QueryDetail) fix QueryDetail may be incorrect and null pointer exception
2023-01-11 16:38:55 +08:00
4424874237 [fix](Nereids): move parentExpression in moveOwnership() (#15786) 2023-01-11 15:47:37 +08:00
006b3bd61a [fix](nereids) orthogonal_bitmap_intersect's return type should be bitmap (#15784) 2023-01-11 12:53:37 +08:00
7f2c433e08 [feature](Nereids) add relation id to unboundTVFRelation to avoid incorrect group expression comparison (#15740) 2023-01-11 12:49:14 +08:00
Pxl
2587095811 [Bug](mv) fix mv selector check group expr && forbid create dup mv with bitmap/hll && add some case (#15738) 2023-01-11 11:38:56 +08:00
3c8c31a5f8 [chore](Session) remove unused codes for enable_lateral_view
session variable `enable_lateral_view` has been removed for a long time.
This cl just remove variable name `enable_lateral_view`.
2023-01-11 11:24:28 +08:00
8f31a36429 [feature] support spill to disk for sort node (#15624) 2023-01-11 08:40:58 +08:00
bc34a44f06 [Fix](Nereids) fix type coercion for binary arithmetic (#15185)
support sql like: select true + 1 + '2.0' and prevent select true + 1 + 'x';
2023-01-11 02:55:44 +08:00
c87a9a5949 [fix](Nereids) Add varchar literal compare (#15672)
support "1" = "123"
2023-01-11 02:41:50 +08:00
280603b253 [fix](nereids) bind sort key priority problem (#15646)
`a.b.c` should only bind on `a.b.c`, not on `b.c` or `c`
2023-01-11 02:03:09 +08:00
ab2e0fd397 [fix](tvf) cancel strict restrictions on tvf parameters (#15764)
Cancel strict restrictions on tvf parameters.
2023-01-10 22:40:19 +08:00
79b24cdb1f [fix](JdbcResource) fix that JdbcResource does not support the jdbcurl of Oracle and SQLServer (#15757)
Actually, `JdbcResource` should support `Oracle` jdbcurl and `SQLServer` jdbcurl for jdbc external table.
2023-01-10 22:38:30 +08:00