Commit Graph

18263 Commits

Author SHA1 Message Date
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
4e868252fc Add .clang-format and docs (#2724)
The problem of inconsistence style in Doris code is too big, it's hard to minimize modification when reformatting code.
So here, our aim is to make the style rules, tune the config in .clang-format.

Note: I choose clang-format-8.0+ to support richer sytle options.
2020-01-11 20:54:20 +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
60dc7c394f Fix rowset state transition bug of release (#2726)
Add on_release to tranfer state when release is called. When release called, state should transfer from unloading to unloaded, not from loaded.
2020-01-10 18:29:54 +08:00
3690f3e917 Add rowset state (#2691)
1. add rowset state to rowset
2. add close api to rowset to release resources
issue: #2665
2020-01-10 14:17:57 +08:00
18a11f5663 Convert from arrow to rowbatch (#2723)
For #2722
In our test environment, Doris cluster used 1 fe and 7 be (32C+128G). When using spakr-doris connecter to query a table containing 67 columns, it took about 1 hour for the query to return 69 million rows of data. After the improvement, the same query condition took 2.5 minutes and the query performance was significantly improved
2020-01-10 14:11:15 +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
4b8f7f9c32 Use cgroups memory limit and cpu cores in container (#2710) 2020-01-10 00:45:50 +08:00
fa4407cf4f Fix bug for cumulative compaction on singleton rowset with multiple segments (#2719)
Row will be scanned mistakenly after cumulative compaction on singleton rowset.
If I have (1, 1), (2, 2), (3, 3) three records.
Now I have read (1, 1), this bug will make return row is (2, 2)
instead of (1, 1).
2020-01-09 21:08:21 +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
87b266cd11 Add cpp connect sample (#2685) 2020-01-08 23:10:58 +08:00
6bc54ef3f0 [Document] Add dynamic partition docs (#2711) 2020-01-08 23:08:48 +08:00
e309eb1d40 [Compaction] Rowset with only one segment should be considered as non-overlapping (#2700)
Currently all singleton rowsets with data are considered overlapping upon construction, even when the rowset contains only one segment. In the meanwhile, singleton rowsets could be input to base compaction (when the tablet hasn't been compacted for base_compaction_interval_seconds_since_last_operation) as long as they are converted into non-overlapping rowsets by cumulative compactor.

By making rowset with one segment non-overlapping, we can avoid the work to convert such rowset to non-overlapping rowset in cumulative compaction.
2020-01-08 23:05:11 +08:00
1c9cfa7e0f Fix invalid to_bitmap input lead to BE core (#2706) 2020-01-08 22:14:37 +08:00
a028c52edd Add BE function bitmap_or and bitmap_and (#2707) 2020-01-08 19:59:44 +08:00
d4a3b34319 [Meta Serialization] Support GSON serialization for class "Type" (#2709)
"Type" is a abstract class, it has 4 sub classes:
1. ScalarType
2. ArrayType
3. MapType
4. StructType

This CL only support ScalarType. Other types can be added later.
2020-01-08 19:56:56 +08:00
e90170a5d0 Fix bug: map erase in txn_manager (#2705) 2020-01-08 18:53:11 +08:00
e94d4656d8 Fix roles typo in privilege document (#2702) 2020-01-08 15:39:10 +08:00
b2b2b661ee Update notice year to 2020 (#2696) 2020-01-08 12:54:03 +08:00
367b4c058c [Doc]Remove used doc content about be_rpc_port (#2694) 2020-01-07 22:20:50 +08:00
13e5fdd512 [AlphaRowset] set num_segments field in rowset meta if missing (#2658)
the num segments should be read from rowset meta pb.
But the previous code error caused this value not to be set in some cases.
So when init the rowset meta and find that the num_segments is 0(not set),
we will try to calculate the num segments from AlphaRowsetExtraMetaPB,
and then set the num_segments field.
This should only happen in some rowsets converted from old version.
and for all newly created rowsets, the num_segments field must be set.
2020-01-07 21:46:02 +08:00
4e2f01a9fa [Compaction] Fix a bug that CumulativeCompaction compares time of different precision (#2693)
time(NULL) returns second-resolution timestamp, however all compaction related time in Tablet are in millis-resolution. Therefore should use UnixMillis() instead.
2020-01-07 21:31:36 +08:00
844ccaafc9 Remove boost filesystem exception in FileUtils (#2692)
If `errer_code` is provided, then the `boost::filesystem` functions
will not throw an exception, so we do not need to catch it.
2020-01-07 07:29:05 -06:00
7d2610d091 Change bitmap functions return type to BITMAP (#2690) 2020-01-07 19:27:21 +08:00
852046de29 Fix incompatibility with arm architecture in olap #2645 (#2682) 2020-01-07 19:16:10 +08:00
72fd745086 [Load] Fix broker load's file format npe bug (#2689) 2020-01-07 16:50:02 +08:00
23e3149d70 [Variable] Fix default rowset type read (#2687)
fix bug of read default rowset type in HeartbeatFlags.
2020-01-07 15:24:03 +08:00
e2c174aecc Fix mysqlChannel npe in ConnectContext (#2684) 2020-01-07 14:54:08 +08:00
2326b478b6 Support load orc format in Apache Doris (#2554)
Support load orc format in Apache Doris
2020-01-07 14:22:43 +08:00
369b2c364f [Build] fix jemalloc download (#2681) 2020-01-07 11:33:55 +08:00
ec860c82c0 [Variable] Fix default rowset type variable (#2680)
Fix defaultRowsetType's type description in SessionVariable
2020-01-07 10:56:18 +08:00
f77171f85d Make bdbje lock timeout configurable (#2676) 2020-01-06 21:20:36 +08:00
40c8bddd24 Decrease transaction_clean_interval_second config (#2673) 2020-01-06 20:16:37 +08:00
9ca7fdfe1c Make MAX_SCHEDULING_TABLETS and MAX_BALANCING_TABLETS configurable (#2670) 2020-01-06 20:15:38 +08:00
4d6afdae4d Add nio support for mysql protocol implementation (#2603) 2020-01-06 18:56:21 +08:00
de4d1778c6 Fix incompatibility with arm architecture in util and gutil (#2650)
1. upgrade  gutil code from imapla  to new verison, include `cpuinfo`, `spinlock` and `linux_syscall_support `
2. impliments arm version  utf8 check code
3. remove incompatible code from stopwatch
2020-01-06 18:39:31 +08:00
c6badaec91 Fix bug: CreateIndexClause can be casted to AlterTableClause (#2667) 2020-01-06 18:31:40 +08:00
7f148c188e [Build]Make set target arch universal (#2660) 2020-01-06 14:46:07 +08:00
87a50070c4 Fix bug: parquet scanner don't seek (#2661) 2020-01-06 13:55:40 +08:00
8a5ee6ad21 Fix FE couldn't start (#2662) 2020-01-06 12:46:45 +08:00
220ed8436c [Unit Test]Fix Schema Change Test Case (#2659) 2020-01-05 20:08:23 +08:00
1648226927 Adapt arrow 0.15 API (#2657)
This CL supports arrow's zero copy read interface, which can make code
comply with arrow 0.15.
And the schema change unit test has some problem, I disable it in run-ut.sh
2020-01-04 15:54:29 +08:00
af9529a207 [Dynamic Partition] Support for automatically adding partitions
In some scenarios, when a user creates an olap table that is range partition by time, the user needs to periodically add and remove partitions to ensure that the data is valid. As a result, adding and removing partitions dynamically can be very useful for users.
2020-01-03 23:45:04 +08:00