Commit Graph

1168 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
fe0260e54f Add a session variable to show or hide hidden columns (#4510)
* add session variable to show hidden columns
2020-09-10 13:07:43 +08:00
c4feb82229 [Bug] Fix null pointer when replay RollupJob (#4572)
When fe replay rollup job(v1) with deleted table, it will throw null pointer exception and exit.
This commit ignore this error and print a warning log to avoid fe exit.

Fixed #4571

Change-Id: I302b554a94d42aee645db6b224cd989e00cd3ca6
2020-09-10 11:55:14 +08:00
7d3fae1257 Remove primary key type (#4555)
disable unsupported primay key table, and optimize unique table toSql(),
make show create table output can exec directly
2020-09-10 09:57:06 +08:00
97dee1f7cf [Bug] Fix enable feature error (#4558)
Fix enable feature may failed, because of base index pass to alter table.
2020-09-10 09:55:19 +08:00
e1225067b8 [UT] Fix ut test (#4545)
Fix SparkLoadPendingTask unit test.
2020-09-08 09:25:57 +08:00
e55327bbc7 [Bug] Fix bug that task_worker_pool not work (#4543)
The number of thread initialized in task worker pool is not right.
This bug is introduced from #4440
2020-09-08 09:25:36 +08:00
8be04fac64 [Variable] Add a new global variable "performance_schema" to support Mysql JDBC 8.0.16 or later.#4537# (#4542) 2020-09-08 09:25:20 +08:00
aae942b982 [Spark Load][Bug] Keep the column splitting in spark load consistent with broker load / mini load (#4532) 2020-09-06 20:33:26 +08:00
8f10317e0d [Spark load][Bug] fix that cancelling a spark load in the PENDING phase will not succeed (#4536) 2020-09-06 20:32:47 +08:00
bcb443fb63 [Feature]Support SELECT Optimizer Hints SET_VAR (#4504) 2020-09-06 20:27:53 +08:00
03d9f6d8b4 [Feature] support hour time unit with dynamic parition (#4514)
Many tables are so large that need seperate partitions with "HOUR" time unit.
But now dynamic partition doesn't support "HOUR" time unit and it was marked as "TODO".
So I support the feature and it works.
2020-09-06 20:25:27 +08:00
13e2cf172f [Log] Add log for trace broker (#4505)
Add tracing broker log. When fe get filestatus for distributing load task to broker,
the broker maybe get empty files and not give correct error code.
Add this log to easy track which broker process filestatus operation and we can get the error log.
2020-09-06 20:25:08 +08:00
a390c9ee9f [Bug] Fix bug that table ids is not set right for hadoop load job (#4535)
We store all table ids involved in the Load Job in TransactionState.
However, for Hadoop Load job, table ids are set incorrectly.

This caused the WAITING_TXN phase to not correctly wait for the completion
of the previous load transaction when doing the alter table,
which caused some data version loss problems.
2020-09-04 17:39:37 +08:00
369e86bbe2 [Spark Load] [Bug] Load job's state will stay in ETL state all the time after FE restart (#4528) 2020-09-04 15:56:54 +08:00
068707484d Support sequence column for UNIQUE_KEYS Table (#4256)
* add sequence  col

Co-authored-by: yangwenbo6 <yangwenbo3@jd.com>
2020-09-04 10:10:17 +08:00
72f04ebdb8 [Bug] Fix bug that query meta fields has been sent twice (#4529)
Fix bug that query meta fields has been sent twice.
This bug is introduced by #4330 , and related PR is #4450
2020-09-04 09:31:14 +08:00
a64c3a7acd [ODBC SCAN NODE] 3/4 Add ODBC_TABLE and ODBC_SCAN NODE in FE. (#4430)
we can create odbc_table use SQL like

```
CREATE EXTERNAL TABLE `baseall_oracle` (
  `k1` decimal(9, 3) NOT NULL COMMENT "",
  `k2` char(10) NOT NULL COMMENT "",
  `k3` datetime NOT NULL COMMENT "",
  `k5` varchar(20) NOT NULL COMMENT "",
  `k6` double NOT NULL COMMENT ""
) ENGINE=ODBC
PROPERTIES (
"host" = "192.168.0.1",
"port" = "8086",
"user" = "happenlee",
"password" = "doris",
"database" = "doris",
"table" = "baseall",
"driver" = "Oracle 19 ODBC driver",
"type" = "oracle"
);
```

Now we only support Oracle and MySQL Database and this feature default turned off by conf enable_odbc_table.
2020-09-04 09:30:01 +08:00
5166a6c6bc [Bug] function str_to_date()'s behavior on BE and FE is inconsistent (#4495)
Main CL:
1. Copy the code from BE to implement the `str_to_date()` function in FE. 
2. `str_to_date("2020-08-08", "%Y-%m-%d %H:%i:%s")` will return `2020-08-08 00:00:00` instead of `2020-08-08`.
2020-09-03 17:16:19 +08:00
d0d394ad7e [SQL][Bug]fix semi/anti join error when table has delete sign column (#4498)
It is possible to report "Illegal column/field reference'table2.DORIS_DELETE_SIGN' of semi-/anti-join"
when executing a semi/anti join statement on a table with hidden columns.
This is because the filter conditions of semi/anti join cannot added in the where statement.

Now we add delete flag related where predicate in OlapScanNode level.
2020-09-03 17:15:15 +08:00
ac3bbdd3ab [BatchDelete] Add a configuration indicating whether to enable the batch delete function (#4493) 2020-09-03 16:56:37 +08:00
c01954719f [Feature][Cache] Sql cache and partition cache #2581 (#4330)
1. Analyze what mode of cache can be used by query
2. Query cache before executing query in StmtExecutor
3. Two cache mode, sqlcache and partitioncache, are implemented
2020-09-02 19:18:42 +08:00
e6367e9ba8 [Bug] Support disable colocate join where join clause has join hint (#4497)
Fix issue:#4496
2020-09-02 10:54:45 +08:00
f5ee854b6f [Spark load][Bug] Fix column terminator for spark load (#4491)
Support specifying column separator without back slash.
2020-09-02 10:54:03 +08:00
1a22f3b2ac [SQL][Function] Validate the param of rand function in compile step (#4439)
The param of rand() function should be literal, but current compiler ignore to
validate the literal param of rand function, it is validated in execution step.
This PR make it validated in compile step, and make it more earlier to find the usage error of rand() function.
2020-09-02 10:50:52 +08:00
f3a9f3f87c Do not add exchange when table's distributioin satisfy the distribution requirements (#4482)
In DistributedPlanner, do not add the unnecessary Exchanges.
For case 1, we only need to judge that the table's distribute hash keys is a subset of the aggregate keys.
For case 2, we should judge two conditions:
 - partition keys are also hash keys.
 - the table's distribute hash keys is a subset of the aggregate keys.
2020-09-01 11:34:53 +08:00
d49566130b [Bug] Fix bug of select @@sql_mode (#4484)
Fix bug that `select @@sql_mode` throw error: Invalid number format.
2020-09-01 11:31:35 +08:00
7b67da30d2 [Spark Load] Redirect the spark launcher's log to a separated log file (#4470) 2020-08-30 21:10:04 +08:00
3b7614e174 [Refactor] Use camelCase in thrift generated java sources (#4443)
Use camelCase in thrift generated java sources to make us fe's code style is more unified
2020-08-28 13:28:11 +08:00
wyb
ec64789e89 [Bug][Colocation Join] Fix colocation balance endless loop bug (#4471)
1. Only one available backend.
2. All backends are checked but this round is not changed. For example, all backends are on the same host.
2020-08-28 09:27:57 +08:00
wyb
82940a4905 [Spark Load] Fix spark load bugs (#4464)
1. fix write dpp result when dpp throw exception
2. boolean value:true, false(IgnoreCase), 0, 1
3. wrong dest column for source data check
4. support * in source file path 
5. if job state is cancelled or finished, submitPushTasks would throw all partitions have no load data exception,
    because tableToLoadPartitions was already cleaned up

#3433
2020-08-27 23:40:33 +08:00
976e3bb219 [Bug][Compile] Add missing imports (#4468)
Co-authored-by: yangwenbo6 <yangwenbo3@jd.com>
2020-08-27 18:14:11 +08:00
ad738fa198 Add OLAP_ERR_DATE_QUALITY_ERR error status to display schema change failure (#4388)
In the process of historical data transformation of materialized views, it may occur that the transformation fails due to data quality.
Add an error status code :OLAP_ERR_DATE_QUALITY_ERR to determine if a data problem is causing the failure

#3344
2020-08-27 17:52:53 +08:00