Commit Graph

809 Commits

Author SHA1 Message Date
2cb82c57bb Fix bug that <=> operator and in operator get wrong result (#1516)
* Fix bug that <=> operator and in operator get wrong result

* Add some comment to get_result_for_null

* Add an new Binary Operator to replace is_safe_for_null for handleing '<=>' operator

* Add EQ_FOR_NULL to TExprOpcode

* Remove macro definition last backslash
2019-07-30 11:17:53 +08:00
97718a35a2 Do not get file size in Broker openReader() method (#1560)
The file is already got when listing files.
Get file size in openReader() again is unnecessary and inefficient.
2019-07-29 23:05:01 +08:00
99836f0d7c Modify load docs (#1558)
Make it work with documentation website
2019-07-29 15:48:59 +08:00
011bdcd641 Bump thirdparty's BZIP2 version to 1.0.8 (#1559) 2019-07-29 00:10:44 +08:00
0694b6a6fa Fix bugs of Broker load (#1546)
Use same UUID as query ID and load ID of a load execution plan.
Each load execution plan has a load ID, and as a plan, there is also a query ID.
We can use same UUID as query ID and load ID, for tracing the load process more easily.

Change the load ID when retrying a load execution plan.
When a load execution plan retry, the load ID should be changed, otherwise BE can not
distinguish the old and new load requests.

Cancel the running loading task when cancelling the broker load.
When user cancel a broker load, the running loading task should also be cancelled, or
it may occupies the worker thread for a long time.

Remove the unnecessary query report when doing load execution plan.
Only the last query report is needed.

Add a new BE config tablet_writer_rpc_timeout_sec.
It is used for RPC of tablet sink. The default is 600 seconds. which is long enough for flushing
about 6GB data. The long timeout config will reduce the possibility of encountering fail to send batch error when loading.

Use streaming_load_max_mb instead of mini_load_max_mb in BE config.

Add more logs for tracing a broker load process easily.
2019-07-27 20:17:05 +08:00
8a7fe521d6 Allow the null default in insert into stmt (#1556)
The default value of null is forbidden in insert into stmt while null column has not been mentioned in stmt.
This is a bug because the unmentioned column has default value. The values should be inserted successfully although the default value is null.

So the column may simply be not assigned default value when the column is not allowed null and the default value of column is null.
2019-07-26 21:32:00 +08:00
abda544d3c Fix bug that getting compatible type for TIME with other types fails (#1544) 2019-07-26 19:10:04 +08:00
6c8d34fa70 Fix bug which make BE crash when load HLL type (#1552) 2019-07-26 11:22:08 +08:00
e8561d71a6 Add dict page (#1409)
Add dict encoding page for binary/string type data. 
Construct a dict for original data, and save encoded id instead of 
origin data to save space. If the dict is too big, then will automatically fall
back to plain encoding.
2019-07-26 09:47:11 +08:00
000e9cf53c Add administrator guide of load (#1488)
The catalogue of load docs:
---- load-manual.md
---- broker-load-manual.md
---- insert-into-manual.md
---- stream-load-manual.md

This commit also changes max/min_stream_load_timeout to max/min_load_timeout.
The old config named stream_load_timeout means the max timeout suited for all types of load.
So the config name has been changed.
2019-07-25 21:02:32 +08:00
473d69e8f8 Fix the mistake in docs of rollup (#1551) 2019-07-25 20:53:41 +08:00
dbc912d2df Unify ColumnSchemaV2 and ColumnSchema to one (#1545)
Currently, we have two versions of ColumnSchema, in this patch, we unify
these two classes to one class.
2019-07-25 10:48:16 +08:00
8160232097 Fix miss delete predicate when clone (#1541)
related issue #1539
2019-07-25 09:16:44 +08:00
e29eceae0a Fix the null pointer exception when ReplayOnAborted of txn in broker load (#1543)
The txn attachment maybe null when broker load has been cancelled without attachment.
The end log of broker load has been record but the callback id of txnState hasn't been removed
So the callback of txn is executed when log of txn aborted is replayed.
2019-07-24 22:17:55 +08:00
0805b05d81 Remove unused FieldInfo (#1540) 2019-07-24 19:33:30 +08:00
4f4c8d1824 Fix Bug: Load fail when we don't specify format type. (#1538) 2019-07-24 15:53:00 +08:00
fde3941185 Remove unused code (#1537) 2019-07-24 14:48:01 +08:00
7c24bf38bc Show load statement support offset (#1531)
Such as `show load order by createtime desc limit 1,2`
2019-07-24 13:27:21 +08:00
a6f0b5c789 Change RowsetWriter num_rows() return int64_t (#1535) 2019-07-24 10:44:38 +08:00
9e2b93a8e2 Fix rowset build validate failure (#1532)
The reason for validate failure is the cloned file's names
may conflict and load segment read file througth cache and
cache key is file name, so index may read wrong file. The
solution is load index without use file handle cache.
2019-07-24 10:08:39 +08:00
68782be7a6 Refactor storage aggregate framework (#1529)
Add AggregateInfo to enclose all functions that used to aggregate value
column.
2019-07-24 10:02:35 +08:00
a88b55e649 Add more logs and metrics to trace the broker load process (#1530)
The Operator wants to known when the job being scheduled as PENDING
and LOADING. And how long it takes to finish these sub states.

Also add 2 metrics on BE to monitor the memtable's flush time.
`memtable_flush_total` and `memtable_flush_duration_us`
2019-07-23 21:42:44 +08:00
69040572fb Use different ID instead of table ID for base index of an OLAP table (#1524) 2019-07-23 15:48:45 +08:00
c34b35e6c4 Add ALTER_TABLET task in be (#1497)
This a for the new implementation of alter table process.
2019-07-23 15:16:21 +08:00
4aedaea84e Support TIME type and timediff function (#1505) 2019-07-23 13:42:39 +08:00
221cd2e103 Fix bug that user with LOAD_PRIV can see load job by SHOW LOAD stmt (#1528)
User should has LOAD_PRIV to use SHOW LOAD stmt, not SHOW_PRIV.
2019-07-23 08:48:23 +08:00
0c8e91adf4 Add storage rowwise iterator (#1515)
Use RowwiseIterator to uniform all data fetch in storage engine.
All objects in storage engine can be read in iterator format.
For example: Segment, Rowset.

This patch implement two generic iterators: UnionRowwiseIterator,
MergeRowwiseIterator. These two class will add iterator as its inputs.

To implement iterators, we define a new class RowBlockV2, all data read
from iterator is in this format. We define a new class other than use
old version's RowBlock is because we want to keep old code work
normally.
2019-07-22 14:35:11 +08:00
cd7ab5af0b Fix variable arguments bug in UDAF (#1523) 2019-07-21 23:11:56 +08:00
7b019ab37f Fix bug that WrapperField does not consider HLL column type when creating (#1514)
This bug may cause BE crash when handling HLL column in some process.
This bug is introduced by code merge. Version 0.10 does not has this bug.
2019-07-19 18:19:23 +08:00
6e1ccbc542 Fix index.rst file for aggregation-function SQL reference docs (#1518) 2019-07-19 18:16:50 +08:00
74eb43206d Fix segment group add zone check bug and remove unused meta log (#1513) 2019-07-19 17:03:19 +08:00
227af49331 Fix rollup bug when init RowCursor in MergeContext (#1510)
When doing rollup, seek_columns equals to the complete set of tablet's columns.
There is no necessity to set it.
Related to commit 36df6ebe4e5f0abd3f07c1e454710590f1de23c7
2019-07-19 14:32:58 +08:00
6c1f95c3a0 Fix bug that BE may crash when closing OlapTableSink (#1507)
The `_profile` in OlapTableSink may not be initialized if `prepare()`
method is not called. So when close the OlapTableSink, we should
check if `_profile` is initialized.
2019-07-19 10:30:44 +08:00
556299aae9 Remove query status report from BE when query is cancelled normally (#1489)
When query result reach limit, the Coordinator in FE will send a cancel
request to BE to cancel the query. And when being cancelled, BE will report
query status to FE for debug purpose. But actually it is not necessary
and will generate too many logs.

So I add a CancelReason to distinguish the difference between 'normally'
cancellation and 'internal error' cancellation. if 'normally' cancelled,
no status will be reported from BE.

When query reach limit, or user cancel it actively, it is being cancelled 'normally'.
Otherwise, the query is cancelled due to internal error, which will need
a report from BE.
2019-07-19 09:36:01 +08:00
1f3f3f76a2 Fix the duplicated request bug of mini load (#1504)
The function of miniLoadBegin will return the txn_id.
If the backend sends the duplicated request to frontend, frontend will return the txn_id which was created by the same mini load.

The issue is that frontend returns the txn_id when the last same request hasn't been begun the txn.
The frontend returns the zero which is initialized txn_id and the be could not execute the load plan with a error txn_id.

The commit conbines the `createLoadJob` and `execute` together in the write lock. It protects the atomicity of `create` and `beginTxn`.
So the duplicated request cannot get the txn id before the last same request is finished.
2019-07-18 23:52:12 +08:00
ca480914de Fix bug that single partition table get wrong partition type (#1503) 2019-07-18 19:17:38 +08:00
36df6ebe4e Fix rollup bug when init RowCursor (#1502)
When doing rollup, seek_columns equals to the complete set of tablet's columns.
There is no necessity to set it.
2019-07-18 18:06:17 +08:00
41499061ac Refactor types.h to reduce code and add UT (#1498) 2019-07-18 12:24:41 +08:00
24592e1124 Add log to trace writer validate failure (#1496)
AlphaRowsetWriter validate rowset failed when build rowset
because rowset's num_rows is not equal to segment groups'
num_rows when add_rowset api is called. So add some log to
trace the process to debug the problems. The logs will be
deleted in the future.
2019-07-18 11:24:41 +08:00
755b12cd75 Add partition id to tablet meta in be (#1490)
FE uses partition_id to publish version. BE should check whether all tablets related with this partition have the version. But Tablet in BE does not have partition id in its metadata. So that BE could not check it.

This patch will add partition id to tablet meta during report task.
Sync at most 10k tablets during set tablet meta.
2019-07-17 14:07:55 +08:00
2551248a52 Support grant GRANT_PRIV on database or table level (#1472)
Currently, GRANT_PRIV can only be granted on global level, which means
it can only be granted on *.*. Grant it on db.* or db.tbl are not allowed.

This will not be able to meet the requirement to create a user who has privilege
to grant privileges to other users on specified database or table, such as:

GRANT SELECT_PRIV ON db1.* TO cmy@'%';

So I extend the range of GRANT_PRIV. User can now grant GRANT_PRIV on
database or even table level, such as:

GRANT GRANT_PRIV ON db1.* TO cmy@'%';

And after being granted, the user cmy@'%' can now grant GRANT_PRIV on db1.* to
other users.
2019-07-16 19:25:18 +08:00
4e043e66e2 Modify the result json format of mini load (#1487)
Mini load is now using stream load framework. But we should keep the
mini load return behavior and result json format be same as old.
So PUBLISH_TIMEOUT error should be treated as OK in mini load.

Also add 2 counters for OlapTableSink profile:
SerializeBatchTime: time of serializing all row batch.
WaitInFlightPacketTime: time of waiting last send packet
2019-07-16 19:15:41 +08:00
a9e8113b82 Fix heap-buffer-overflow in split_part() function in StringFunctions (#1482) 2019-07-15 23:00:37 +08:00
6c246418fb Add timeout in stream load planner (#1480)
Mini load timeout needs to be added in plan options.
The timeout property has been added in request of process put.
Otherwise, the timeout of mini load is useless.

Add log of label, txn and query id in mini load
2019-07-15 22:14:59 +08:00
d61a2daeea Remove unused code (#1483) 2019-07-15 21:59:06 +08:00
0d48a3961c Refactor Storage Engine (#1478)
NOTE: This patch would modify all Backend's data.
And this will cause a very long time to restart be.
So if you want to interferer your product environment,
you should upgrade backend one by one.

1. Refactoring be is to clarify the structure the codes.
2. Use unique id to indicate a rowset.
   Nameing rowset with tablet_id and version will lead to
   many conflicts among compaction, clone, restore.
3. Extract an rowset interface to encapsulate rowsets
   with different format.
2019-07-15 21:18:22 +08:00
ae6f2d99c5 Fix bug when use SELECT * FROM TABLE LIMIT 1 (#1469) 2019-07-13 23:57:14 +08:00
5be3e73325 Build snappy with optimize-options enabled (#1467) 2019-07-13 21:27:17 +08:00
aff1559c4d FixBug: if columns of doris table less than parquet file columns , BE will be crash (#1464) 2019-07-12 15:23:13 +08:00
863eb83cb1 Delete deprecated code in Frontend (#1463)
1. Delete Clone/CloneJob/CloneChecker
    The old clone framework is deprecated, using TabletChecker/TabletScheduler instead
2. Delete old BackupJob/RestoreJob
3. Delete OP_DROP_USER edit log
4. Delete CLONE_DONE edit log
2019-07-12 13:34:05 +08:00