Commit Graph

13721 Commits

Author SHA1 Message Date
a3bcdf7b44 [docs](docs)Fix docker example doc (#20472)
fix run-docker-cluster docs docker volumes:conf
2023-06-06 15:24:32 +08:00
0337dd573c [fix](docker)Fix docker example script (#20471)
remove docker example script volumes: conf
2023-06-06 15:24:04 +08:00
f1db1f3663 [fix](docker)Fix BE init script Bug (#20470)
change /bin/env bash -> /bin/bash
2023-06-06 15:23:35 +08:00
5184b31620 [feature](docker)Add new example MySQL-Flink-Doris Demo (#20469)
Add new example MySQL-Flink-Doris Demo
2023-06-06 15:23:11 +08:00
fe63a0a3bb [Feature](multi-catalog)support paimon catalog (#19681)
CREATE CATALOG paimon_n2 PROPERTIES (
"dfs.ha.namenodes.HDFS1006531" = "nn2,nn1",
"dfs.namenode.rpc-address.HDFS1006531.nn2" = "172.16.65.xx:4007",
"dfs.namenode.rpc-address.HDFS1006531.nn1" = "172.16.65.xx:4007",
"hive.metastore.uris" = "thrift://172.16.65.xx:7004",
"type" = "paimon",
"dfs.nameservices" = "HDFS1006531",
"hadoop.username" = "hadoop",
"paimon.catalog.type" = "hms",
"warehouse" = "hdfs://HDFS1006531/data/paimon1",
"dfs.client.failover.proxy.provider.HDFS1006531" = "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider"
);
2023-06-06 15:08:30 +08:00
ae428c29e2 [feature](planner)(nereids) support user defined variable (#20334)
Support user-defined variables.
After this PR, we can use `set @a = xx` to define a user variable and use it in the query like `select @a`.

the changes of this PR:
1. Support the grammar for `set user variable` in the parser.
2. Add the `userVars` in `VariableMgr` to store the user-defined variables.
3. For the `set @a = xx`, we will store the variable name and its value in the `userVars` in `VariableMgr`.
4. For the `select @a`, we will get the value for the variable name in `userVars`.
2023-06-06 14:35:16 +08:00
0fce7b9011 [fix](http) Let the sdk find the httpclient package determined (#20205) 2023-06-06 14:20:38 +08:00
1f032a551d [Improve](array-functions) support array first function (#20397)
add array_first(lambda, [1,2,3,null]) function for doris
2023-06-06 12:08:46 +08:00
1b94b6368f [fix](load) in strict mode, return error for insert if datatype convert fails (#20378)
* [fix](load) in strict mode, return error for load and insert if datatype convert fails

Revert "[fix](MySQL) the way Doris handles boolean type is consistent with MySQL (#19416)"

This reverts commit 68eb420cabe5b26b09d6d4a2724ae12699bdee87.

Since it changed other behaviours, e.g. in strict mode insert into t_int values ("a"),
it will result 0 is inserted into table, but it should return error instead.

* fix be ut

* fix regression tests
2023-06-06 12:04:03 +08:00
65100d8083 [improvement](profile)add max/min rpc time (#20339) 2023-06-06 12:03:01 +08:00
e553615a27 [opt](Nereids) perfer use datev2 / datetimev2 in date related functions (#20224)
1. update all date related functions' signatures order. 
1.1. if return value need to be compute with time info, args with datetimev2 at the top of the list, followed by datev2, datetime and date
1.2. if return value need to be compute with only date info, args with datev2 at the top of list, followed by datetimev2, date and datetime
2. Priority for use datev2, if we must cast date to datev2 or datetime/datetimev2
2023-06-06 11:42:29 +08:00
c56eddbfa9 [bug](jdbc) fix trino date/datetime filter (#20443)
When querying Trino's JDBC catalog, if our WHERE filter condition is k1 >= '2022-01-01', this format is incorrect. 
In Trino, the correct format should be k1 >= date '2022-01-01' or k1 >= timestamp '2022-01-01 00:00:00'. 
Therefore, the date string in the WHERE condition needs to be converted to the date or timestamp format supported by Trino.
2023-06-06 11:20:42 +08:00
2fc1141c5f [test](regression) update some case in p2 (#20436) 2023-06-06 11:05:56 +08:00
d02737a293 [feature](struct-type) support struct_element function (#19045)
This commit support a function allows return a field column in named struct column.
Since the function can return any type, this commit also supports ANY_STRUCT_TYPE
and ANY_ELEMENT_TYPE.
2023-06-06 10:44:08 +08:00
f839c90c27 [fix][refactor](backend-policy)(compute) refactor the hierarchy of external scan node and fix compute node bug #20402
There should be 2 kinds of ScanNode:

OlapScanNode
ExternalScanNode
The Backends used for ExternalScanNode should be controlled by FederationBackendPolicy.
But currently, only FileScanNode is controlled by FederationBackendPolicy, other scan node such as MysqlScanNode,
JdbcScanNode will use Mix Backend even if we enable and prefer to use Compute Backend.

In this PR, I modified the hierarchy of ExternalScanNode, the new hierarchy is:

ScanNode
    OlapScanNode
    SchemaScanNode
    ExternalScanNode
        MetadataScanNode
        DataGenScanNode
        EsScanNode
        OdbcScanNode
        MysqlScanNode
        JdbcScanNode
        FileScanNode
            FileLoadScanNode
            FileQueryScanNode
                MaxComputeScanNode
                IcebergScanNode
                TVFScanNode
                HiveScanNode
                    HudiScanNode
And previously, the BackendPolicy is the member of FileScanNode, now I moved it to the ExternalScanNode.
So that all subtype ExternalScanNode can use BackendPolicy to choose Compute Backend to execute the query.

All all ExternalScanNode should implement the abstract method createScanRangeLocations().

For scan node like jdbc scan node/mysql scan node, the scan range locations will be selected randomly from
compute node(if preferred).

And for compute node selection. If all scan nodes are external scan nodes, and prefer_compute_node_for_external_table
is set to true, the BE for this query will only select compute nodes.
2023-06-06 10:35:30 +08:00
c7888f4bfa [feature](profile)Add the filtering info of the in filter in profile #20321
image Currently, it is difficult to obtain the id of in filters,so, the some in filters's id is -1.
2023-06-06 10:24:59 +08:00
378ffa133e [fix](regression-test) Add lost ddl file for tpcds_sf1_p2 #20288 2023-06-06 09:57:38 +08:00
5f4ccb1f2e [fix](load) fix generate delete bitmap in memtable flush (#20446)
1. Generate delete bitmap for one segment at a time.
2. Generate delete bitmap before segment compaction.
Fix #20445
2023-06-06 09:48:30 +08:00
22eec4148b [fix](conf) fix fe host in doris-cluster.conf #20422 2023-06-06 09:15:36 +08:00
1fc48e83f2 [fix](executor)Fix duplicate timer and add open timer #20448
1 Currently, Node's total timer couter has timed twice(in Open and alloc_resource), this may cause timer in profile is not correct.
2 Add more timer to find more code which may cost much time.
2023-06-06 08:55:52 +08:00
4f77578d8a [enhancement](profile) add build get child next time (#20460)
Currently, build time not include child(1)->get next time, it is very confusing during shared hash table scenario. So that I add a profile.

---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-06-06 08:55:19 +08:00
6c96e1dc9f [fix](regression) add sync after streamload in test_stream_load (#20425)
Add sync after streamload in test_stream_load to fix following error:

Exception in load_p0/stream_load/test_stream_load.groovy(line 180):

                throw exception
            }
            log.info("Stream load result: ${result}".toString())
            def json = parseJson(result)
            assertEquals("success", json.Status.toLowerCase())
            assertEquals(1, json.NumberTotalRows)
            assertEquals(0, json.NumberFilteredRows)
        }
    }
    order_qt_sql1 " SELECT * FROM ${tableName2}"
^^^^^^^^^^^^^^^^^^^^^^^^^^ERROR LINE^^^^^^^^^^^^^^^^^^^^^^^^^^

    // test common case
    def tableName3 = "test_all"
    def tableName4 = "test_less_col"
    def tableName5 = "test_bitmap_and_hll"
    def tableName6 = "test_unique_key"
    def tableName7 = "test_unique_key_with_delete"
    def tableName8 = "test_array"
    def tableName10 = "test_struct"
    sql """ DROP TABLE IF EXISTS ${tableName3} """

Exception:
java.lang.IllegalStateException: Check tag 'sql1' failed:
Check tag 'sql1' failed, line 1 mismatch, real line is empty, but expect is 2019  9  9  9  7.700  a  2019-09-09  1970-01-01T08:33:39  k7  9.0  9.0
sql:
 SELECT * FROM load_nullable_to_not_nullable
2023-06-06 08:32:25 +08:00
b7fc17da68 [feature-wip](multi-catalog)(step2)support read max compute data by JNI (#19819)
Issue Number: #19679
2023-06-05 22:10:08 +08:00
e576d533b2 [typo](doc)Remove useless hints (#20457)
Co-authored-by: hechao <hechao@selectdb.com>
2023-06-05 21:13:52 +08:00
0a90a9d507 [feature-wip](duplicate_no_keys) Add some test cases of all the duplicate tables in test case tpcds_sf100_dup_without_key_p2 and make them duplicate tables without keys (#20431) 2023-06-05 21:04:41 +08:00
25aa86087c [fix](audit) Fix the error of peakMemoryBytes in the audit log (#20449) 2023-06-05 21:02:18 +08:00
05d497d21e [fix](sequence) value predicates shouldn't be push down when has sequence column (#20408)
* (fix)[sequence] value predicates shouldn't be push down when has sequence column

* add case
2023-06-05 19:18:34 +08:00
fac0b50f56 [Fix](Planner)fix cast date/datev2/datetime to float/double return null. (#20008) 2023-06-05 19:06:50 +08:00
92721c84d3 [improve](nereids)derive analytics node stats (#20340)
1. derive analytic node stats, add support for rank()
2. filter estimation stats derive updated. update row count of filter column.
3. use ColumnStatistics.orginal to replace ColumnStatistics.orginalNdv, where ColumnStatistics.orginal is the column statisics get from TableScan.
TPCDS 70 on tpcds_sf100 improved from 23sec to 2 sec
This pr has no performance downgrade on other tpcds queries and tpch queries.
2023-06-05 18:56:20 +08:00
c7dd7c2eba Fix query hang when using queue (#20434) 2023-06-05 18:12:26 +08:00
7d11db0807 [fix](Nereids) throw NPE when sql cannot be parsed by all planner (#20440) 2023-06-05 17:49:08 +08:00
ae8914d5c8 [fix](memory) Fix meta_tool start failed #20045 2023-06-05 17:09:13 +08:00
bc65e9b5fb [fix](MTMV) Support star expressions in select list (#20355) 2023-06-05 17:06:05 +08:00
5b2efd196b [fix](execution) result_filter_data should be filled by 0 when can_filter_all is true (#20438) 2023-06-05 17:05:35 +08:00
9d39fd7aae [fix](Nereids): fix filter can't be pushdown unionAll (#20310) 2023-06-05 16:56:25 +08:00
f0b0bda04a [Fix](Nereids) Fix duplicated name in view does not throw exception (#20374)
When using nereids, if we have duplicated name in output of view, we need to throw an exception. A check rule was added in bindExpression rule set
2023-06-05 16:10:54 +08:00
20bf309ffb [test](p2) Fix p2 output (#20432) 2023-06-05 15:58:04 +08:00
1cb4c7bc51 [enhancement](function) Compatible with python 2.6 and keep the code style consistent (#20429) 2023-06-05 15:33:38 +08:00
a66d5a6ae0 [fix](workload-group) fix workload group non-existence error (#20428) 2023-06-05 15:33:26 +08:00
fe942eaf44 [Fix](Nereids) Fix minidump using put all of hashmap (#20268)
Minidump file wants to get information as much as possible, but when close the switch, these methods should not be called after refactor pr: #20049. Other place of doing more jobs after add Minidump feature also be checked.
2023-06-05 13:05:15 +08:00
0dc6d3a568 [fix](nereids) avg size of column stats always be 0 (#20341)
it takes lot of effort to compute the avgSizeByte for col stats.
we use schema information to avoid compute actual average size
2023-06-05 13:01:58 +08:00
cd0379df4e [fix](nereids) select with specified partition name is not work as expected (#20269)
This PR is to fix the select specific partition issue, certain codes related to this feature were accidentally deleted.
2023-06-05 12:48:54 +08:00
d03bb4ba7b [Optimize](function) Optimize locate function by compare across strings (#20290)
Optimize locate function by compare across strings. about 90% speed up test by sum()
2023-06-05 12:43:14 +08:00
3c28a71378 [fix](dynamic partition) partition create failed after alter distributed column (#20239)
This pr fix following two problems:

Problem1: Alter column comment make add dynamic partition failed inside issue #10811

create table with dynamic partition policy;
restart FE;
alter distribution column comment;
alter dynamic_partition.end to trigger add new partition by dynamic partition scheduler;
Then we got the error log, and the new partition create failed.
dynamic add partition failed: errCode = 2, detailMessage =      Cannot assign hash distribution with different distribution cols. default is: [id int(11) NULL COMMENT 'new_comment_of_id'], db: default_cluster:example_db, table: test_2
Problem2: rename distributed column, make old partition insert failed. inside #20405

The key point of the reproduce steps is restart FE.

It seems all versions will be affected, include master and lts-1.1 and so on.
2023-06-05 12:20:50 +08:00
d392791114 [Chore](docs)Remove the Committer-related description in the contribution guide (#20418) 2023-06-05 12:03:48 +08:00
a6d8115cbc [Improvement](planner) expand sql-block-rule to make it can be used on all kinds of sql stmt (#19540)
Currently, sql-block-rule can only be used for query statements, while it's useful for other stmts like insert / delete / alter / drop etc. Now remove the limitation and expand its using scenario.
2023-06-05 11:01:43 +08:00
660ab34147 [fix](multicatalog) support read from hive table with HIVE_UNION_SUBDIR in path location (#20329) 2023-06-05 11:01:24 +08:00
12f89b879f [fix](stats) Analysis info lost after checkpoint (#20412)
1. Implement write/read for AnalysisManager 
2. If database or table has any column with complex type, the analyze stmt would fail directly. Enable to ignore complex type columns and analyze rest of them in this PR
2023-06-05 10:51:02 +08:00
c6387847aa [fix](nereids) change defaultConcreteType function's return value for decimal (#20380)
1. add default decimalv2 and decimalv3 for NullType
2. change defaultConcreteType of decimalv3 to this
2023-06-05 10:50:07 +08:00
90a5be913c [enhancement](merge-on-write) avoid unecessary pk index iteration while memtable flushing (#20244) 2023-06-05 10:48:33 +08:00