Commit Graph

2378 Commits

Author SHA1 Message Date
e072002edc [Doc] Update data-model-rollup.md (#4659)
fix typo
2020-09-25 10:26:05 +08:00
4e3b576fd3 [NewFeature] Support ExternalCatalogResource to simplify external table manage operation. (#4559)
1. Add new Resource ExternalCatalogResource

```
create external resource "odbc"
properties
(
   "type" = "external_catalog", (required)
   "user" = "test",(required)
   "password" = "", (required)
   "host" = "192.168.0.1", (required)
   "port" = "8086", (required)
   "type" = "oracle" , (optinal,only odbc exteranl table use)
   "driver" = "Oracle 19 ODBC driver" (optional,only odbc exteranl table use)
)
```

2.After create ExternalCatalogResource, can create external table like:

```
CREATE TABLE `test_mysql` (
  `k1` tinyint(4) NOT NULL,
  `k2` smallint(6) NOT NULL,
  `k3` int(11) NOT NULL,
  `k4` bigint(20) NOT NULL,
  `k5` decimal(9,3) NOT NULL,
  `k6` char(5) NOT NULL,
  `k10` date DEFAULT NULL,
  `k11` datetime DEFAULT NULL,
  `k7` varchar(20) NOT NULL,
  `k8` double NOT NULL,
  `k9` float NOT NULL
) ENGINE=MYSQL
PROPERTIES (
"external_catalog_resource" = "odbc",
"database" = "test",
"table" = "test"
);
```
2020-09-25 10:20:33 +08:00
a61d0de173 [ODBC SCAN NODE] 4/4 Add ODBC_SCAN_NODE and Odbc_Scanner in BE and add ODBC_SCAN_NODE docs (#4438) 2020-09-25 10:19:50 +08:00
04e2ce2acb [Compile] Fix md5 of thirdparty(#4663)
Fix compile error when compile Doris from source and not using docker
2020-09-24 19:00:58 +08:00
f87e294caa [License] Add license header (#4664) 2020-09-24 18:59:04 +08:00
f0576beb7a 【bug】Fix unit test bug (#4653) 2020-09-24 16:22:39 +08:00
e5f8c7cfc7 [BUG] Fix transaction not be cleared after BE down. (#4661)
After BE down, transactions related should be cleared.
The hostname is used to retrive the transactions.
But hostname is recorded as hostname + port, the port
should be removed.
2020-09-24 16:00:20 +08:00
724f70a405 Fix all queries failed when one BE network or disk has issue (#4651) 2020-09-23 15:25:08 +08:00
e7d9438fd9 [Bug] Fix analysis error when there are different types in case-when-then-else with group by clause (#4646) 2020-09-23 11:15:28 +08:00
fd37c4f352 [Document] Fix some typo in alter table document
Fix some typos in document that confusing users.
2020-09-22 16:23:23 +08:00
1821d1baea [Compile] Add pluginRepository for java-cup-plugins (#4636)
the cup-maven-plugin of net.sourceforge.czt.dev is missing in maven central repo.
It has been moved to https://repository.cloudera.com/content/groups/public/

Co-authored-by: morningman <chenmingyu@baidu.com>
2020-09-21 12:38:28 +08:00
01894c82fe [Bug] Fix bug that wrong usage for HashBasedTable iterator may cause ConcurrentModificationException (#4631)
Fix bug that wrong usage for HashBasedTable iterator may cause ConcurrentModificationException
2020-09-20 20:58:08 +08:00
cf91c7062a [SQL][Bug]Fix join Predicate transitivity bug (#4629) 2020-09-20 20:57:50 +08:00
2a637f848d [Refactor] Remove meaningless return value of RowBlock::init (#4627)
Simplify some code, mainly remove meaningless return value of RowBlock::init.
2020-09-20 20:57:00 +08:00
531cf11e6e [BUG] Some function in odbc external table different in Doris (#4625) (#4626)
Now Doris do not push down filter contains function in OdbcScanNode
Except Mysql external table.
2020-09-20 20:56:36 +08:00
3ae64884f8 [Syntax] Support CTE statement without use db (#4622) 2020-09-20 20:56:11 +08:00
ea45f4107e [Syntax]Change force order in Drop db, Drop table, Drop partition stmt (#4615) 2020-09-20 20:55:43 +08:00
ab059928c8 [Bug] catch IllegalArgumentException in DynamicPartitionScheduler (#4613) 2020-09-20 20:55:20 +08:00
0f811941fe [Bug] Fix the bug of #4608, support order by, where, limit in show alter table rollup (#4611)
support order by, where, limit in `show alter table rollup`
2020-09-20 20:54:43 +08:00
985ec98a9b [Bug] Fix the calculation of the variable "left_bytes" in data_dir.cpp (#4609)
Suppose that the current available byte in a disk is `_available_bytes`. After the data with size of `incoming_data_size` is written in the disk,  the left space in the disk should be calculated as follow :
  `int64_t left_bytes = _available_bytes - incoming_data_size;`
rather than:
  `int64_t left_bytes = _disk_capacity_bytes - _available_bytes - incoming_data_size;`
2020-09-20 20:54:13 +08:00
d01ef41a0a [Doc] modify documents of dynamic partition (#4607)
If some partitions between `dynamic_partition.start` and `dynamic_partition.end` are lost
due to some unexpected circumstances when using dynamic partition.
the lost partitions between the current time and `dynamic_partition.end` will be recreated,
but the lost partitions between `dynamic_partition.start` and the current time will not be recreated.
2020-09-20 20:53:13 +08:00
3e8b0618fd [Bug] Fix bug that forwarding show tablet stmt return error (#4605)
When forwarding show tablet stmt to Master FE. If the result contains null, FE will throw exception.
Fix it by using `\N` instead of "null" in result, to make thrift rpc happy.
2020-09-20 20:52:23 +08:00
00f25c2b77 [Bug] Tablet and Disk report thread not work (#4597)
The tablet and disk information reporting threads need to report to the FE periodically.
At the same time these two reporting threads will also be triggered by certain events.

The modification in PR #4440 caused these two threads to be triggered only by events,
and could not report regularly.
2020-09-20 20:51:52 +08:00
5f43fb3bde [Cache][BE] LRU cache for sql/partition cache #2581 (#4005)
1. Find the cache node by SQL Key, then find the corresponding partition data by Partition Key, and then decide whether to hit Cache by LastVersion and LastVersionTime
2. Refers to the classic cache algorithm LRU, which is the least recently used algorithm, using a three-layer data structure to achieve
3. The Cache elimination algorithm is implemented by ensuring the range of the partition as much as possible, to avoid the situation of partition discontinuity, which will reduce the hit rate of the Cache partition,
4. Use the two thresholds of maximum memory and elastic memory to control to avoid frequent elimination of data
2020-09-20 20:50:51 +08:00
065b979f35 [Bug] behavior of function str_to_date() and date_format() on BE and FE is inconsistent (#4612)
1. add date range check in `DateLiteral` for `FEFunctions`
2. `select str_to_date(202009,'%Y%m')` and `select str_to_date(str,'%Y%m') from tb where tb.str = '202009'` will return same output `2020-09-00`.
3. add support of zero-date to function `str_to_date()`,`date_format()` 
4. fix FE can calculate negative value bug, eg: `select str_to_date('-2020', '%Y')` will return `NULL` instead of date value.

current behavior is same as MySQL **without** sql_mode `NO_ZERO_IN_DATE` and `NO_ZERO_DATE`.

**current behavior**
```
mysql> select siteid,str_to_date(siteid,'%Y%m%d') from table2  order by siteid;
+------------+---------------------------------+
| siteid     | str_to_date(`siteid`, '%Y%m%d') |
+------------+---------------------------------+
|          1 | 2001-00-00                      |
|          2 | 2002-00-00                      |
|          2 | 2002-00-00                      |
|          3 | 2003-00-00                      |
|          4 | 2004-00-00                      |
|          5 | 2005-00-00                      |
|         20 | 2020-00-00                      |
|        202 | 0202-00-00                      |
|       2020 | 2020-00-00                      |
|      20209 | 2020-09-00                      |
|     202008 | 2020-08-00                      |
|     202009 | 2020-09-00                      |
|    2020009 | 2020-00-09                      |
|   20200009 | 2020-00-09                      |
|   20201309 | NULL                            |
| 2020090909 | 2020-09-09                      |
+------------+---------------------------------+

mysql> select str_to_date('2','%Y%m%d'),str_to_date('20','%Y%m%d'),str_to_date('202','%Y%m%d'),str_to_date('2020','%Y%m%d'),str_to_date('20209','%Y%m%d'),str_to_date('202009','%Y%m%d'),str_to_date('2020099','%Y%m%d'),str_to_date('20200909','%Y%m%d'),str_to_date('2020090909','%Y%m%d'),str_to_date('2020009','%Y%m%d'),str_to_date('20200009','%Y%m%d'),str_to_date('20201309','%Y%m%d');
+----------------------------+-----------------------------+------------------------------+-------------------------------+--------------------------------+---------------------------------+----------------------------------+-----------------------------------+-------------------------------------+----------------------------------+-----------------------------------+-----------------------------------+
| str_to_date('2', '%Y%m%d') | str_to_date('20', '%Y%m%d') | str_to_date('202', '%Y%m%d') | str_to_date('2020', '%Y%m%d') | str_to_date('20209', '%Y%m%d') | str_to_date('202009', '%Y%m%d') | str_to_date('2020099', '%Y%m%d') | str_to_date('20200909', '%Y%m%d') | str_to_date('2020090909', '%Y%m%d') | str_to_date('2020009', '%Y%m%d') | str_to_date('20200009', '%Y%m%d') | str_to_date('20201309', '%Y%m%d') |
+----------------------------+-----------------------------+------------------------------+-------------------------------+--------------------------------+---------------------------------+----------------------------------+-----------------------------------+-------------------------------------+----------------------------------+-----------------------------------+-----------------------------------+
| 2002-00-00                 | 2020-00-00                  | 0202-00-00                   | 2020-00-00                    | 2020-09-00                     | 2020-09-00                      | 2020-09-09                       | 2020-09-09                        | 2020-09-09                          | 2020-00-09                       | 2020-00-09                        | NULL                              |
+----------------------------+-----------------------------+------------------------------+-------------------------------+--------------------------------+---------------------------------+----------------------------------+-----------------------------------+-------------------------------------+----------------------------------+-----------------------------------+-----------------------------------+
```
2020-09-17 10:10:19 +08:00
a1f52ec2ab [SQL] Support where, limit, order clause in show resourcestmt. (#4502)
* [SQL] Support where, limit, order clause in show resourcestmt.

Grammar

    SHOW RESOURCES
    [
        WHERE
        [NAME [ = "your_resource_name" | LIKE "name_matcher"]]
        [RESOURCETYPE = ["SPARK"]]
    ]
    [ORDER BY ...]
    [LIMIT limit][OFFSET offset];

issue #4501
2020-09-16 17:57:48 +08:00
4f7cfee908 [compaction][config] Change default config policy to size_based (#4599)
(1) change default compaction config policy to size_based
(2) change missed version check policy when delete stale rowsets
2020-09-16 15:04:06 +08:00
a88782e0c5 [UI Part 4] A new UI for Frontend (#4602)
A new FE UI interface implemented with React framework.
Need to work with the new Spring framework and RESTful API in #4596.

This is a simple UI for Doris. User can develope their own UI if they want

Proposal #4308
2020-09-16 15:03:24 +08:00
17a8b57018 [UI Part 3] New implemented HTTP RESTful API of Frontend (#4596)
Use spring mvc rest to replace the original netty http rest
Created a new package `org/apache/doris/httpv2`,
and the origin implementations under `org/apache/doris/http` remain unchanged.

This part of the code will not be used at present, so it will not affect existing functions.

API document can be found in #4584 

Proposal #4308
2020-09-16 15:02:59 +08:00
1191048f5f [UI Part 2] Add HTTP API documents of Frontend (#4584)
Origin:

bootstrap-action
cancel-load-action
check-decommission-action
check-storage-type-action
config-action
connection-action
get-ddl-stmt-action
get-load-info-action
get-load-state
get-log-file-action
get-small-file
ha-action
hardware-info-action
health-action
log-action
meta-action
meta-info-action
meta-replay-state-action
profile-action
query-detail-action
query-profile-action
row-count-action
session-action
set-config-action
show-data-action
show-proc-action
show-runtime-info-action
system-action
table-query-plan-action
table-row-count-action
table-schema-action

New:

logout-action
show-meta-info-action
statement-execution-action
upload-action
2020-09-16 15:02:38 +08:00
95111f9228 [Feature] Support alter table syntax for sequence column (#4582)
* enable sequence col

Co-authored-by: yangwenbo6 <yangwenbo3@jd.com>
2020-09-15 10:19:38 +08:00
9419c73472 [Bug] Fix bug that BE will crash when querying information_schema.columns (#4595) 2020-09-14 15:47:08 +08:00
e8e5f350fe [BUG] ReAgg when adding agg mv on dup base table (#4587)
When the keystype of mv and base table is difference, Doris should execute
sorting schema change instead of linked schema change.
If doesn't, the data size of mv actually is same as base table.
This will cause mv to have no pre-aggregation effect at all.
The query will not choose mv.

This commit fixed this problem. Fixed #4586
2020-09-13 19:17:35 +08:00
4f4c22b459 [SQL][Planner] Support int datekey format implicit cast to date (#4591) 2020-09-13 19:15:53 +08:00
8c4f9d9a73 [Bug] Set BoolLiteral's selectivity (#4590)
`BoolLiteral`'s `selectivity`should be 1 when it is true else 0.
2020-09-13 19:15:26 +08:00
2f0d725a25 [Batch Delete] Add a session variable to show or hide hidden columns (#4579)
Sometimes we need to show hidden columns for debug.
So we need to add a session variable to show or hide hidden columns
2020-09-13 19:14:31 +08:00
b9829003fb [SQL][Planner] Fix the the parallesim of fragment which has 3 or more childern #4569 (#4570)
fix the the parallelism of fragment which has 3 or more childern
2020-09-13 19:14:00 +08:00
3e36505aea [Bug]Fix bug that tablet info with wrong capacity may cause fe oom (#4567)
* [Bug]Fix bug that tablet info with wrong capacity may cause fe oom

* remove unused code

* fix

* remove empty line

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2020-09-13 19:13:28 +08:00
c38593702f [Config] Add default configuration of max_fiter_ratio #4541# (#4553)
Co-authored-by: shqmh <shqmh@126.com>
2020-09-13 19:12:45 +08:00
4571b09dd6 [storage][compatibility] Add meta format detection to prevent data loss. (#4539)
After 0.12 version, doris remove the format convert functiion which can convert from hdr_ format
to tabletmeta_ format when loading metas, the commit link: 3bca253

When we update doris version and there are old format meta in storage,
BE will not read the old format tablet. It can lead to data loss.

So we add meta format detection function to prevent data loss.
When there are old format meta in olap_meta, BE can find and print log or exit.
2020-09-13 11:58:22 +08:00
2c24fe80fa [SparkDpp] Support complete types (#4524)
For[Spark Load]
1 support decimal andl largeint
2 add validate logic for char/varchar/decimal
3 check data load from hive with strict mode
4 support decimal/date/datetime aggregator
2020-09-13 11:57:33 +08:00
4caa6f9b33 [Bug] fix get_parsed_paths() subscript out of range (#4585) 2020-09-12 16:04:21 +08:00
e26d5d0da0 [MemTracker] show all MemTrackers on BE's website (#4580)
We can show all MemTrackers on BE's website by calling MemTracker::ListTrackers().
2020-09-12 11:18:50 +08:00
704bcec9d3 [Bug] add_batch check state fix (#4575) 2020-09-12 11:18:10 +08:00
7afc66f8fe [Bug] catch plugin init error for Reinstall plugin (#4561) 2020-09-12 11:17:46 +08:00
31e451b8c7 [Feature] Doris can set default configuration of database data quota and replica quota #4540# (#4550)
When Doris create a database, the database of data quota and replica quota is initialized by configuration(Config.default_db_data_quota_bytes and Config.default_db_replica_quota_bytes).
In other words, I convert FeConstants.default_db_data_quota_bytes to Config.default_db_data_quota_bytes
Config.default_db_data_quota_bytes can be change in configuration file.
2020-09-12 11:17:27 +08:00
fe0f3ffbab [Bug] Fix bug that colocate join can not perceive parameter parallel_fragment_exec_instance_num (#4546) (#4547)
The instance of colocate join should be limit by the parameter parallel_fragment_exec_instance_num.
2020-09-12 11:16:31 +08:00
6e9d2074fb [UI Part 1] Update pom.xml of Frontend (#4583)
Add spring related dependencies
2020-09-11 17:48:42 +08:00
356bfcf065 fix (#4577)
Fix batch delete not work when using broker load, becuase of merger type not initialized
2020-09-11 09:45:22 +08:00
81784d6471 Revert "Add a session variable to show or hide hidden columns (#4510)" (#4576)
This reverts commit fe0260e54f8dfa37260423cffcf42096de19ed1f.
2020-09-10 15:18:36 +08:00