Commit Graph

573 Commits

Author SHA1 Message Date
d8cfbbedf7 Support bitmap_empty function (#2227) 2019-11-18 20:37:00 +08:00
c5ce72215d Optimize tablet report with expired transaction. (#2215)
When there are lots of expired transactions on BE, and with large
number of tablet, the report thread may become to slow. Because it
has to iterate the whole transaction map for each tablet.

But this is unnecessary. We should first build a expired transaction
map with 'tablet id' as key. And for each tablet, we only need to seek
the expired transaction map once with tablet id, instead of traversing
the whole transaction map.
2019-11-15 23:03:21 +08:00
84c1fa88b8 Add node dead num metrics for all types of node (#2191)
Following metrics will show the number of nodes which are down.

frontend_down_num
backend_down_num
broker_down_num
2019-11-13 23:25:51 +08:00
11872d5cf6 Sending clear txn task explicitly after transaction being aborted (#2182) 2019-11-13 11:22:45 +08:00
b4d630137a Fix DB meta lost bug 2 (#2174) 2019-11-12 09:35:27 +08:00
1695d8ffc7 Clean the fe/target directory before building (#2173)
Clean the fe/target directory before building
Otherwise, the fe output dir will contains some deprecated libraries.
2019-11-11 22:04:17 +08:00
06befc45ed Support decrease edit_log_roll_num config (#2171) 2019-11-11 14:20:32 +08:00
288cf1ec80 Fix DB meta lost bug (#2167) 2019-11-11 11:02:21 +08:00
9eaba67606 Limit the FE log file number (#2163)
1. upgrade log4j to 2.12.1
2. Add 2 new FE config:
        'sys_log_delete_age' and default is '7d', for sys log.
        'audit_log_delete_age' and default is '30d', for audit log.

   it means if a log's last modification time is 7/30 days ago, it will be deleted.
2019-11-11 09:12:57 +08:00
48d9318d07 Support date_add function to support partition prune (#2154)
Currently in the date_add/date_sub functions (DATE_ADD(DATETIME date,INTERVAL expr type)), the expr parameter is the interval you want to add.
Doris will convert these functions to xxx_sub/xxx_add. However, there is only the days_add function in fe, which causes other date_add formats, such as select date_add('2010-11-30 23:59:59', INTERVAL 2 DAY), cannot be pruned.

So I've added other functions to support fe partition prune
2019-11-08 18:57:21 +08:00
3886503c02 Fix bug of core in multi join (#2164)
The result of function named getHashLookupJoinConjuncts() are the predicates which already adjust the order of left and right child.
2019-11-08 18:55:38 +08:00
42395d2455 Change Null-safe equal operator from cross join to hash join (#2156)
* Change Null-safe equal operator from cross join to hash join
ISSUE-2136

This commit change the join method from cross join to hash join when the equal operator is Null-safe '<=>'.
It will improve the speed of query which has the Null-safe equal operator.
The finds_nulls field is used to save if there is Null-safe operator.
The finds_nulls[i] is true means that the i-th equal operator is Null-safe.
The equal function in hash table will return true, if both val and loc are NULL when finds_nulls[i] is true.
2019-11-08 12:43:48 +08:00
af79485eb2 Ignore --helper start argument if not first time to start FE (#2159) 2019-11-08 08:48:11 +08:00
89dc461f91 Fix UT and remove unused code (#2160) 2019-11-08 08:47:48 +08:00
d461a451d7 Add log info for QueryPlanAction (#2152) 2019-11-07 22:48:20 +08:00
2efd9e54ea Optimize the query plan so that UnionNode can be executed distributedly (#2150) 2019-11-07 19:41:06 +08:00
5a4908e99a Forward stmt with stmt id generated on origin FE. (#2129)
Some stmt, such as DDL and DML stmt will be forwarded from non-master FE
to Master FE. But these stmt will be logged in non-master FE's audit log
with its origin stmt id generated on non-master FE.

So we should also pass this origin stmt id to Master, so that we can track
this stmt's execution process more easily.
2019-11-07 10:28:15 +08:00
7b4ae7df06 Merge pull request #2141 from morningman/modify_routine_load_log
Add some log to detect deadlock of routine load job
2019-11-06 16:09:56 +08:00
96f60ea6ca Add some log to detect deadlock of routine load job 2019-11-06 15:57:51 +08:00
7ad72bbcb8 Enable decimalV2 cast to different precision (#2131)
The precision of cast function is useless. For example,
Query: select cast(10 as decimal(1,0));
Result: 10
Although numeric field is overflow, the numeric could be return.

So, the cast function from decimal(a,b) to decimal(c,d) could not be executed.
2019-11-05 20:31:23 +08:00
65c3b0907a Support aggregation type of REPLACE_IF_NOT_NULL (#2127)
Some use has the requirment that only some of columns will be update in
one load operation, and others will retain as original. However, Doris
can't handle this situation, because user must specify value for all
columns. Then if a column aggregation method is REPLACE, use must query
original value to overwrite it. This often needs some work for user to
do.

If this CL is applied, user can use REPLACE_IF_NOT_NULL instead of
REPLACE. Then when load data to table, if user don't intent to change
value of this column, user can specify NULL for this column. Doris will
retain original value for this column.
2019-11-05 18:08:34 +08:00
d2e34310ef Fix bug that UpdateTabletMetaInfoTask not returned (#2119) 2019-11-05 09:23:41 +08:00
d83eec7a14 Fix META read (#2125)
PR #2083 introduce a meta read bug, which will ignore already written data.
2019-11-04 18:44:04 +08:00
ac5dd0c9f2 Support sql mode (#2083)
At present, we do not support SQL MODE which is similar to MySQL. In MySQL, SQL MODE is stored in global session and session with a 64 bit address,and every bit 0 or 1 on this address represents a mode state. Besides, MySQL supports combine mode which is composed of several modes.

We should support SQL MODE to deal with sql dialect problems. We can heuristically use the MySQL way to store SQL MODE in session and parse it into string when we need to return it back to client.

This commit suggests a solution to support SQL MODE. But it's just a sample, and the mode types in SqlModeHelper.java are not really meaningful from now on.
2019-11-01 23:21:00 +08:00
45df6aae08 Fix some routine load bugs (#2093)
Mainly fix the following issues:

1. A null pointer exception is raised when a database or table is dropped. The expected behavior is that the routine load job is stopped.

2. Memory leaks. Batch routine load task submissions are no longer performed, and modifications are submitted separately for each task.

3. Unreasonable task timeout.
    Routine load tasks should not be queued in the BE thread pool for execution. The task sent to the BE should be executed immediately, otherwise the task in the FE will be timeout first. Eventually leads to constant timeout for all subsequent tasks.

4. All routine load job should be scheduled once it being submitted. Not waiting the available BE slot. Otherwise, all later submitted jobs may not be scheduled forever.
2019-10-31 21:53:03 +08:00
95a3b4ccfe Add object type (#1948)
Add a new type: Object. Currently, it's mainly for complex aggregate metrics(HLL , Bitmap).

The Object type has the following constraints:
1 Object type could not as key column type
2 Object type doesn't support all indices (BloomFilter, short key, zone map, invert index)
3 Object type doesn't support filter and group by

In the implementation:

The Object type reuse the StringValue and StringVal, because in storage engine, the Object type is binary, it has a pointer and length.
2019-10-31 21:42:58 +08:00
e7d6bbd336 Fix explain InsertStmt NPE in FOLLOWER node (#2097) 2019-10-31 14:10:43 +08:00
5e8c96f28b Optimize FE start logic (#2052) 2019-10-31 11:11:50 +08:00
03d384ac51 Add .rat_excludes file, and modify related documents (#2031) (#2105) 2019-10-31 10:34:22 +08:00
6fd63a8f3c Add the cast function for if function in outer join (#2087)
[QUERY]
The type of function which is different from the type of expr will return the incorrect result in query.

Example:
  the type of expr is date
  the type of function is int
  So, the upper fragment will receive a int value instead of date while the result expr is date.
  If there is no cast function, the result of query will be incorrect.
2019-10-29 11:07:17 +08:00
5e3ba03b52 Awareness of Backend down when loading data (#2076) 2019-10-28 20:18:44 +08:00
b6e3725c5d Fix bug that tablet failed to be committed when no data is loaded (#2064) 2019-10-25 16:36:35 +08:00
78a5a84e06 Remove drop repository name toLowerCase (#2060)
Repository's name is case sensitive
2019-10-24 20:06:13 +08:00
4848c94262 Fix bug that unable to add bloom filter columns (#2054) 2019-10-24 14:08:52 +08:00
751a219f0a Add the unchecked cast from date literal to others (#2021)
Fix the ISSUE:2017
This commit enable the cast function in date.
The date literal can be cast to target type which is implicitly castable such as int, bigint, largeint.
2019-10-21 13:57:50 +08:00
3f325e001a Change the priority of different type in function (#2003)
This commit fix the issue [ISSUE-2002].
It changes the priority of coalesce, ifnull, nullif function etc.
The priority of decimal is higher then varchar in the IS_SUPERTYPE_OF compare mode.

Example:
select coalesce(decimal_column, 1) from table;
    the return type of coalesce should be decimal instead of varchar.

Add supertype about datetime and date
The supertype of datetime is bigint, largeint etc.
In IS_SUPERTYPE_OF compare mode, the function(bigint, bigint, bigint) is a supertype of function(datetime, bigint, int).

Example:
select coalesce(now(), 1)) from web_returns;
    the return type of coalesce should be bigint instead of varchar.
2019-10-18 09:35:49 +08:00
c3b5046940 Fix bug of invalid stream load task rollback (#1999)
If stream load be committed with result PUBLISH_TIMEOUT, it should not rollback
this transaction, but only return this message to user.
2019-10-17 21:08:29 +08:00
d9bb494d7f Fix bug that insert stmt with label return label already exist. (#2006) 2019-10-17 20:00:12 +08:00
3c12af4dcc Limit the memory consumption of broker scan node (#1996)
If memory exceed limit, no more row batch will be pushed to batch queue
2019-10-17 14:40:16 +08:00
ac16318c9b [Bug-fix][Broker-load] Fix the bug of the label already exists when the txn has been finished (#1992)
If FE is restarted between txn committed and visible, the load job will be rescheduled and failed with label already exists.
The reason is that there are inconsistency between transaction of load job and meta of load job.
So, the replay of the txn attachment need to be done in function replayOnCommitted.
The load job state and progress is correct after that.
2019-10-16 16:35:18 +08:00
41e55cfca9 Modify fixed partition feature (#1989)
1. Not support MAVALUE in multi partition column.
2. Fix the incorrect show create table stmt.
2019-10-16 16:03:46 +08:00
63fa260d3f Support prepare/close in UDF (#1985)
The prepare/close step of scalar function is already supported in execution framework, We only need to do is that support it in syntax and meta in frontend.

In addition, 'Hive' binary type of scalar function NOT supports prepare/close step, we need to make it supports.
2019-10-16 07:19:20 +08:00
ec7c8a2c6f Support adding fixed range partition
eg: ALTER TABLE test_table ADD PARTITION p0125 VALUES [("20190125"), ("20190126"));
2019-10-15 09:50:30 +08:00
62acf5d098 Limit the memory usage of Loading process (#1954) 2019-10-15 09:26:20 +08:00
c3a3212ae5 Bump netty-all from 4.1.25.Final to 4.1.42.Final in /fe (#1959)
Bumps [netty-all](https://github.com/netty/netty) from 4.1.25.Final to 4.1.42.Final.
- [Release notes](https://github.com/netty/netty/releases)
- [Commits](https://github.com/netty/netty/compare/netty-4.1.25.Final...netty-4.1.42.Final)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-14 23:05:00 +08:00
ccc236484b Fix bug that failed to add KEY column to DUPLICATE KEY table (#1973) 2019-10-14 16:40:34 +08:00
463b462b8d Add create_time to information_schema.tables 2019-10-12 21:45:14 +08:00
ce236bfcd4 add alter table modify limit: Cannot change DATETIME to DATE (#1963) 2019-10-12 19:11:17 +08:00
bbb3fdef8c Fix bug that OlapTableSink use invalid column as distribution column for RANDOM distribution table. (#1956)
RANDOM distribution is deprecated long time ago, this is just for compatibility and bug fix.
2019-10-11 20:07:25 +08:00
4a17152f40 Add tdigest compression param for pencentile_approx function (#1939) 2019-10-11 18:56:59 +08:00