Commit Graph

726 Commits

Author SHA1 Message Date
7be2871c36 [GroupingSet] Disable column both in select list and aggregate functions when using GROUPING SETS/CUBE/ROLLUP (#2921) 2020-02-18 13:56:56 +08:00
625411bd28 Doris support in memory olap table (#2847) 2020-02-18 10:45:54 +08:00
11b43700b9 [Alter] Fix pending AlterJobV2 replay bug (#2922)
Call replayPending method when load pending status AlterJobV2.
So that the tablet and replica won't missing in TabletInvertedIndex.
2020-02-17 23:02:18 +08:00
0fb52c514b [UDF] Fix bug that UDF can't handle constant null value (#2914)
This CL modify the `evalExpr()` of ExpressionFunctions, so that it won't change the
`FunctionCallExpr` to `NullLiteral` when there is null parameter in UDF. Which will fix the
problem described in ISSUE: #2913
2020-02-17 22:13:50 +08:00
1089f09d26 [Syntax] Fix bug introduced by #2906 (#2917) 2020-02-17 21:41:03 +08:00
1e3b0d31ea [Rollup] Change table's state right after all rollup jobs are done (#2904)
In the current implementation, the state of the table will be set until the next round of job scheduling. So there may be tens of seconds between job completion and table state changes to NORMAL.

And also, I made the synchronized range smaller by replacing the synchronized methods with synchronized blocks, which may solve the problem described in #2903
2020-02-14 21:28:51 +08:00
1f7c03d998 [FIX] Fix a sqlparser conflict by KW_PROPERTIES (#2907)
fix a sqlparser conflict by KW_PROPERTIES, now change KW_PROPERTIES's precedence to right, so it must use like PROPERTIES()
2020-02-14 21:08:50 +08:00
5386c92383 [FIX] Fix a sqlparser conflict imported by PR #2725 (#2906)
Fix a sqlparser conflict imported by pr #2725, in that pr add some time unit to keyword
I have moved those to time_unit
2020-02-14 21:06:01 +08:00
0e997a8798 Fix a sql_parser.cup conflict by a duplicated show index stmt (#2894) 2020-02-14 12:00:23 +08:00
83d33cec25 [Syntax] Fix alter rollup stmt Shift/Reduce conflict (#2897) 2020-02-14 11:49:14 +08:00
ed95352ecd support intersect and except syntax (#2882) 2020-02-13 16:48:46 +08:00
f2875ceb73 [Index] Add column type check when creating bitmap index (#2883) 2020-02-12 23:05:16 +08:00
3e160aeb66 [GroupingSet] fix a bug when using grouping set without all column in a grouping set item (#2877)
fix a bug when using grouping sets without all column in a grouping set item will produce wrong value.
fix grouping function check will not work in group by clause
2020-02-12 21:50:12 +08:00
1f001481ae Support batch add and drop rollup indexes #2671 (#2781) 2020-02-11 12:58:01 +08:00
feb02ab27a Make intersect_count function accept any expression that returns bitmap (#2850) 2020-02-07 09:56:54 +08:00
d549c40fcd Fix spelling mistakes for load metrics description (#2840) 2020-02-06 10:18:30 +08:00
bb4a7381ae [UnitTest] Support starting mocked FE and BE process in unit test (#2826)
This CL implements a simulated FE process and a simulated BE service. 
You can view their specific usage methods at 

`fe/src/test/java/org/apache/doris/utframe/DemoTest.java`

At the same time, I modified the configuration of the maven-surefire-plugin plugin,
so that each unit test runs in a separate JVM, which can avoid conflicts caused by 
various singleton classes in FE.

Starting a separate jvm for each unit test will bring about 30% extra time overhead. 
However, you can control the number of concurrency of unit tests by setting the `forkCount`
 configuration of the maven-surefire-plugin plugin in `fe/pom.xml`. The default configuration 
is still 1 for easy viewing of the output log. If set to 3, the entire FE unit test run time is about
 4 minutes.
2020-02-03 21:17:57 +08:00
bb00f7e656 [Load] Fix bug of wrong file group aggregation when handling broker load job (#2824)
**Describe the bug**

**First**, In the broker load, we allow users to add multiple data descriptions. Each data description
 represents a description of a file (or set of files). Including file path, delimiter, table and 
partitions to be loaded, and other information.

When the user specifies multiple data descriptions, Doris currently aggregates the data 
descriptions belonging to the same table and generates a unified load task.

The problem here is that although different data descriptions point to the same table, 
they may specify different partitions. Therefore, the aggregation of data description
 should not only consider the table level, but also the partition level.

Examples are as follows:

data description 1 is: 
```
DATA INFILE("hdfs://hdfs_host:hdfs_port/input/file1")
INTO TABLE `tbl1`
PARTITION (p1, p2)
```

data description 2 is:
```
DATA INFILE("hdfs://hdfs_host:hdfs_port/input/file2")
INTO TABLE `tbl1`
PARTITION (p3, p4)
```
What user expects is to load file1 into partition p1 and p2 of tbl1, and load file2 into paritition
p3 and p4 of same table. But currently, it will be aggregated together, which result in loading
file1 and file2 into all partitions p1, p2, p3 and p4.

**Second**, the following 2 data descriptions are not allowed:

```
DATA INFILE("hdfs://hdfs_host:hdfs_port/input/file1")
INTO TABLE `tbl1`
PARTITION (p1, p2)
DATA INFILE("hdfs://hdfs_host:hdfs_port/input/file2")
INTO TABLE `tbl1`
PARTITION (p2, p3)
```

They have overlapping partition(p2), which is not support yet. And we should throw an Exception
to cancel this load job.

**Third**, there is a problem with the code implementation. In the constructor of 
`OlapTableSink.java`, we pass in a string of partition names separated by commas. 
But at the `OlapTableSink` level, we should be able to pass in a list of partition ids directly,
 instead of names.


ISSUE: #2823
2020-02-03 20:15:13 +08:00
5dc80dc05d [Maven] Fix some mistake in fe/pom.xml (#2818) 2020-01-21 10:38:46 +08:00
2a30ac2ba5 [SQL] Return NullLiteral in castTo method instead of throwing a exception (#2799) 2020-01-21 10:20:31 +08:00
9dc9051930 Remove unused code for ShowPartitionsStmtTest and add apache license header (#2808) 2020-01-20 22:51:26 +08:00
58ff952837 [Stmt] Support new show functions syntax to make user search function more conveniently (#2800)
SHOW [FULL] [BUILTIN] FUNCTIONS [IN|FROM db] [LIKE 'function_pattern'];
2020-01-20 14:14:42 +08:00
92d8f6ae78 [Alter] Allow submitting alter jobs when table is unstable
Alter job will wait table to be stable before running.
2020-01-18 22:56:37 +08:00
ae018043b0 [Alter] Support replication_num setting for table level (#2737)
Support replication_num setting for table level, so There is no need for user to set replication_num for every alter table add partition statement.

eg:
`alter table tbl set ("default.replication_num" = "2");`
2020-01-18 21:17:22 +08:00
23f472903a [Routine Load] Fix a bug that show routine load will throw Unknown Exception
If we connect to a non-master FE and execute `show routine load;`. It may sometimes
throw Unknown Exception, because some of fields in thrift result is not set.
2020-01-17 20:46:00 +08:00
6365a7d559 [FE Maven] Change maven repository url from http to https (#2786)
From January 15th, 2020, Requests to http://repo1.maven.org/maven2/ return a 501 HTTPS Required status.
So switch central repository url from http to https
2020-01-17 16:45:04 +08:00
fc55423032 [SQL] Support Grouping Sets, Rollup and Cube to extend group by statement
Support Grouping Sets, Rollup and Cube to extend group by statement
support GROUPING SETS syntax 
```
SELECT a, b, SUM( c ) FROM tab1 GROUP BY GROUPING SETS ( (a, b), (a), (b), ( ) );
```
cube  or rollup like 
```
SELECT a, b,c, SUM( d ) FROM tab1 GROUP BY ROLLUP|CUBE(a,b,c)
```

[ADD] support grouping functions in expr like grouping(a) + grouping(b) (#2039)
[FIX] fix analyzer error in window function(#2039)
2020-01-17 16:24:02 +08:00
463c0e87ec Replace PowerMock/EasyMock by Jmockit (4/4) (#2784)
This commit replaces the PowerMock/EasyMock in our unit tests. (All)
2020-01-17 14:09:00 +08:00
753a7dd73a Replace PowerMock/EasyMock by Jmockit (3/4) 2020-01-16 13:24:43 +08:00
0ddca59d36 Add timestampadd/timestampdiff function (#2725) 2020-01-15 21:47:07 +08:00
9bc306d17c Replace PowerMock/EasyMock by Jmockit (2/4) (#2749) 2020-01-15 20:31:30 +08:00
4496ebb632 [Alter View] Fix bug that alter view operation lost when replaying from image (#2773)
When "replay" something, we should use Catalog.getCurrentCatalog() instead
of Catalog.getInstance(), otherwise, we may get wrong Catalog instance.
2020-01-15 20:04:09 +08:00
54952a24ad Remove and comment some FE code (#2766) 2020-01-15 15:14:52 +08:00
9e54751098 [Snapshot] Modify the prefer snapshot version (#2748)
In this CL, prefer snapshot version in snapshot request is defined
in thrift. So that both FE and BE can use this version value.
2020-01-15 15:10:14 +08:00
70c7281bf2 [Routine Load] Fix bug that history routine load jobs are cleaned prematurely 2020-01-15 11:18:34 +08:00
e5717efc5a [Insert] Return more info of insert operation (#2718)
Standardize the return results of INSERT operations,
which is convenient for users to use and locate problems.

More details can be found in insert-into-manual.md
2020-01-15 10:39:53 +08:00
9bafcc99f6 Don't balance when Available BE num equals or less then tablet Replica num (#2740) 2020-01-15 10:39:18 +08:00
ef6cd9ae25 Add files to gitignore (#2753) 2020-01-14 22:29:56 +08:00
fafc684e0d [External Table] Fix bug that query external hdfs table throw NPE. (#2756) 2020-01-14 15:44:54 +08:00
1ccd377b33 [Colocate Table] Fix colocate table balance forever (#2744) 2020-01-13 23:13:58 +08:00
273edced77 Replace PowerMock/EasyMock by Jmockit (1/3) (#2732)
This commit replaces the PowerMock/EasyMock in our unit tests, But not all.
PS.(The tests relevant to DescribeStmt are ignored until I find a way to fix it)
2020-01-13 21:28:18 +08:00
a99a49a444 Add bitamp_to_string function (#2731)
This CL changes:

1. add function bitmap_to_string and bitmap_from_string, which will
 convert a bitmap to/from string which contains all bit in bitmap
2. add function murmur_hash3_32, which will compute murmur hash for
input strings
3. make the function cast float to string the same with user result
logic
2020-01-13 12:31:37 +08:00
e00343b6ec Choose tablets in ConsistencyChecker in batch (#2736) 2020-01-11 20:45:06 +08:00
089b358dcd Skip dropped be when choose dest be in TabletScheduler (#2734) 2020-01-11 20:32:26 +08:00
e391fe1e70 [SQL] Ignore the null type when getCmpType (#2730)
In previous versions, if the children of the IN predicate included NULL, all child types would be converted to DOUBLE for calculation.
For example:
select * from t1 where k1 in ('TABLE', NULL);
But children like varchar cannot be converted to double, so the query cannot be executed.
The error is "TABLE is not a number"

The current version, if null exists in the child, it will not enter the calculation of compatibility type.
For the above query, the compatibility type is varchar, so the 'TABLE' is not converted to double, and the query could be executed.

Also, for JDBC. It will convert 'show tables;' to :
```
SELECT
TABLE_SCHEMA AS TABLE_CAT, NULL AS TABLE_SCHEM, TABLE_NAME,
 CASE WHEN TABLE_TYPE='BASE TABLE'
 THEN CASE WHEN TABLE_SCHEMA = 'mysql' OR TABLE_SCHEMA = 'performance_schema'
 THEN 'SYSTEM TABLE' ELSE 'TABLE'END WHEN TABLE_TYPE='TEMPORARY'
 THEN 'LOCAL_TEMPORARY' ELSE TABLE_TYPE END AS TABLE_TYPE, TABLE_COMMENT AS REMARKS, NULL AS TYPE_CAT, NULL AS TYPE_SCHEM, NULL AS TYPE_NAME, NULL AS SELF_REFERENCING_COL_NAME, NULL AS REF_GENERATION
 FROM INFORMATION_SCHEMA.TABLES
 WHERE TABLE_SCHEMA LIKE 'test_db'
 AND TABLE_NAME LIKE '%'
 HAVING TABLE_TYPE IN ('TABLE','VIEW',null,null,null)
 ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME
```
In previous version, Doris could not return the correct tables to JDBC. It will thrown the error "'TABLE' is not a number".
After this commit, #2729 is fixed. Doris could return the tables schema by JDBC.
2020-01-11 14:03:50 +08:00
ccaa97a5ac Make bitmap functions accept any expression that returns bitmap (#2728)
This CL make bitmap_count, bitmap_union, and bitmap_union_count accept any expression whose return type is bitmap as input so that we can support flexible bitmap expression such as bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(2))).

This CL also create separate documentation for each bitmap UDF to conform with other functions.
2020-01-11 14:02:12 +08:00
81be684bae [FE Meta]fix schema change job write edit log error (#2721)
fix when there is no indexChange still write editlog and will not read
2020-01-10 11:12:03 +08:00
e7b763309d Skip missing version replica when getQueryableReplicas (#2715) 2020-01-09 17:19:23 +08:00
425b1cf29b Fix port already in use (#2716) 2020-01-09 16:01:17 +08:00
f7cea6dda5 CreateViewStmt/AlterViewStmt support cte and fix bug (#2641)
This commit contains the following changes:
1. Let create/alter view statement support cte sql. (Issue #2625 )

e.g.
```
Alter view test_tbl_view (h1, h2)
as
with testTbl_cte (w1, w2) as 
(
    select col1, col2 from testDb.testTbl
)
select w1 as c1, sum(w2) as c2 from testTbl_cte 
where w1 > 10 
group by w1 order by w1
```

2. Fix the bug that view's schema remains unchanged after replaying alter view. (Issue #2624 )
2020-01-08 23:11:38 +08:00