Commit Graph

722 Commits

Author SHA1 Message Date
e57419fc9e [feature](nereids) Date add and Date sub related functions (#14753)
## date_add series
- DATE_ADD
- DAYS_ADD
- ADDDATE
- TIMESTAMPADD

## date_sub series
- DATE_SUB
- DAYS_SUB
- SUBDATE

## NOTE
1. For DAYS_XXX, time unit is omissible, by default the time unit is DAY
2. no TIMESTAMPSUB
2022-12-12 21:34:30 +08:00
b5c0d4870d [fix](nereids)fix bug of elt and sub_replace function (#14971) 2022-12-12 17:37:36 +08:00
33bd9eb85e [fix](nereids) Support syntax of nested CTE (#14962) 2022-12-12 17:03:44 +08:00
38570312dd [feature](split_by_string)support split by string function (#13741) 2022-12-12 15:22:30 +08:00
33349c3419 [feature](function)Support negative index for function split_part (#13914) 2022-12-12 09:56:09 +08:00
f3aea7f0f0 [Enhancement](status) Unify error code and enable customed err msg for BE internal errors (#14744) 2022-12-11 23:33:18 +08:00
9eeb8b8711 [Bugfix](Jsonb) fix jsonb load in unique key model (#14958)
* [Bugfix](Jsonb) fix jsonb load in unique key model

Register JSONB to `replace_load` agg function

* fix test
2022-12-09 21:10:14 +08:00
8c02f19302 [chore](regression) use correct bucket path in regression conf (#14960) 2022-12-09 16:20:27 +08:00
93b281b44b [feature](Nereids) support select except syntax (#14851)
Support syntax: select * except(v1, v2) from t;
2022-12-09 15:54:26 +08:00
b213ce6ffd [Bug](pipeline) Fix double prepare on pipeline engine (#14959) 2022-12-09 14:35:34 +08:00
3209e49541 [Regression](pipeline) remove ssb test for pipeline (#14953) 2022-12-09 09:08:09 +08:00
e8becaa562 [refactor](resource) unified resource user interface (#14842)
At present, there are multiple user interface to access hdfs and s3.
Each interface has its own configuration and is different, which causes confusion for users.
Create resource already supports remote storage resources and resource permission management,
but only `spark`/`odbc_catalog` are in use.
Cloud  storage resources need to be created and managed uniformly through create resource.

This PR contains the following changes:

1. Add `s3`, `hdfs` and `hms` resource, and each resource contains it's own configuration items, and delete configuration items scattered in other classes.

2. Use `resource` to create `storage` tools, and use `storage` tools to access the remote file system.
2022-12-08 20:37:10 +08:00
c0b764e419 [fix](schemachange) fix the schema change that causes the be core dump. (#14804)
* [fix](schemachange) fix the schema change that causes the be core dump.

Forbid schema change to add or modify the key column of the agg model as double or float.
2022-12-08 17:36:54 +08:00
Pxl
375e0e08ca [Bug](predicate) fix ccore dump on varchar with in list predicate (#14881)
* fix ccore dump on varchar with in list predicate

* update case

* Update sqlsmith01.sql
2022-12-08 17:14:23 +08:00
0c817e6b3a [Pipeline](hashjoin) Support hash join on pipeline engine (#14898) 2022-12-08 15:43:02 +08:00
2fb896d916 [feature](nereids) Support using join syntax (#14784) 2022-12-08 15:22:41 +08:00
be3f3978c8 [enhancement](test) remove sf1DataPath conf from regression-conf.groovy (#13861) 2022-12-08 11:24:25 +08:00
27c8147a2b [fix](multi-catalog) use last used database for catalog when switch back (#14793)
remember last used database of every catalog and use it when switch back
2022-12-08 10:32:30 +08:00
962810b973 [Vectorized](jdbc) add check type for jdbc table (#14501) 2022-12-08 10:27:47 +08:00
a3095e29d5 [fix](nereids)translate is not null predicate mistake (#14866)
the 'is not null' predicate is not translated correctly in ExpressionTranslator
2022-12-07 20:14:13 +08:00
a078a0d602 [test](catalog)add some emr hive case (#14848) 2022-12-07 14:41:57 +08:00
6b5e10c8be [fix](agg)having clause should use alias if there is no group by clause (#14831) 2022-12-07 14:13:17 +08:00
3286fb48ab [fix](if) fix coredump of if const (#14858) 2022-12-07 09:43:10 +08:00
1304185adb [Regression](Fix) fix the regression of pipeline and ConcurrentModificationException failed (#14849)
* [fix](ut) try to fix ConcurrentModifycationException bug

* [Regression](Fix) fix the regression of pipeline and ConcurrentModificationException failed

Co-authored-by: morningman <morningman@163.com>
2022-12-06 15:34:32 +08:00
3e911a05b1 [fix](fe)fix select from temporary partition bug (#14809) 2022-12-06 14:32:35 +08:00
e578e2cd98 [Enhancement](Nereids) Explain display extra information (#14802)
# Proposed changes

Issue Number: close #14554

## Problem summary

1. provide a function **Plan.extraPlans** that returns extra plans, eg: LogicalSubQueryAlias in LogicalCTE.
2. combine the extra plans and the children in the AbstractPlan.treeString(), distinguished by the * at the beginning.
```
========== PARSED PLAN ==========
LogicalCTE ( aliasQueries=[LogicalSubQueryAlias ( alias=s )] )
|-*LogicalSubQueryAlias ( alias=s )
|  +--LogicalProject ( projects=['s_suppkey] )
|     +--LogicalFilter ( predicates=('s_suppkey = '') )
|        +--LogicalCheckPolicy ( child=UnboundRelation ( nameParts=supplier ) )
|           +--UnboundRelation ( nameParts=supplier )
+--LogicalProject ( projects=[*] )
   +--LogicalJoin ( type=CROSS_JOIN, hashJoinConjuncts=[], otherJoinConjuncts=[] )
      |--LogicalSubQueryAlias ( alias=t1 )
      |  +--LogicalCheckPolicy ( child=UnboundRelation ( nameParts=s ) )
      |     +--UnboundRelation ( nameParts=s )
      +--LogicalSubQueryAlias ( alias=t2 )
         +--LogicalCheckPolicy ( child=UnboundRelation ( nameParts=s ) )
            +--UnboundRelation ( nameParts=s )
```
2022-12-06 12:28:40 +08:00
fcea89bcf4 [fix](const_expr) fix coredump caused by unsupported cast const expr (#14825) 2022-12-06 10:31:15 +08:00
0a33508d3b [chore](regression) add S3 config in conf file and change sf1DataPath #14815 2022-12-06 10:00:50 +08:00
1190fd4cd6 [Pipeline](regression) Add ssb flat for pipeline (#14763) 2022-12-05 15:05:23 +08:00
494dba6c2b [improvement](fix) return only if all sqls inside one sql file run out (#14791) 2022-12-05 10:18:45 +08:00
ed96442b85 [fix](multi-catalog) fix persist issue about jdbc catalog and class loader issue #14794
Fix a bug that JDBC catalog/database/table should be add to GsonUtil

Fix a class loader issue that sometime it will cause ClassNotFoundException

Fix regression test to use different catalog name.

Comment out 2 regression tests:

regression-test/suites/query_p0/system/test_query_sys.groovy
regression-test/suites/statistics/alter_col_stats.groovy
Need to be fixed later
2022-12-05 09:05:13 +08:00
283b23f6da [fix](planner) wrong results when select from view which has with clause (#14747) 2022-12-02 18:10:52 +08:00
7627defc88 [fix](regression-test) Add test data for test_mysql_jdbc_catalog and fix mysql-5.7.yaml about UTF8 (#14749)
Fix two things:
1. Fix that the MySQL table displays the garbled code even if the UTF8 is specified for table.
2. Fix that `test_mysql_jdbc_catalog.out` lack of returned data for table `ex_tb13`.
2022-12-02 11:58:11 +08:00
07e8af7808 [regression](test) add external regression-test base on emr environment 1.0 11-29 (#14666)
* add external regression-test base on emr environment 1.0 11-29

* delete ak sk info from regression-conf.groovy
2022-12-02 11:30:07 +08:00
ae6a007c4e [test](jdbc)add new extremum case (#14692) 2022-12-02 11:28:11 +08:00
94a6ffb906 [feature](compaction) support vertical_compaction & ordered_data_compaction (#14524) 2022-12-01 22:15:41 +08:00
2be8235d95 [feature](nereids) support timestampdiff function (#14662)
complete timeStampDiff
supported timeunit:
 - YEAR 
 - MONTH
 - WEEK
 - DAY
 - HOUR
 - MINUTE
 - SECOND
2022-12-01 22:11:55 +08:00
9dd1d989e8 [test](decimalv3) add regression test cases for decimalv3 (#14672) 2022-12-01 15:18:40 +08:00
6c70d794f6 [fix](bitmapfilter) fix core dump caused by bitmap filter (#14702) 2022-12-01 09:56:22 +08:00
738c36109f rename tpch dir (#14668) 2022-11-30 17:59:13 +08:00
11735043d6 [improvement](test) logging load result (#14694)
When a load failed, we have to login to doris to investigate result.
2022-11-30 16:57:35 +08:00
79688a54d6 [bug](jsonb) fix be core at insert invalid json to JSONB column (#14686) 2022-11-30 14:00:50 +08:00
f3cf83a933 (fix)[test] add some logs (#14695) 2022-11-30 12:45:12 +08:00
9272680d00 [feature](multi-catalog) support Jdbc catalog (#14527)
Issue Number: close #xxx

I add jdbc catalog for doris multi-catalog feature.
Currently, the jdbc catalog only supports MYSQL DBMS.

TODO:

support for postgre DB
Support for other databases.
Problem summary
For jdbc catalog, we can create catalog like:

CREATE CATALOG jdbc4 PROPERTIES (
    "type"="jdbc",
    "jdbc.user"="root",
    "jdbc.password"="123456",
    "jdbc.jdbc_url" = "jdbc:mysql://127.0.0.1:13396/demo?yearIsDateType=false",
    "jdbc.driver_url" = "file:/mnt/disk2/ftw/tools/jar/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar",
    "jdbc.driver_class" = "com.mysql.jdbc.Driver"
);
Note:
yearIsDateType is a param of jdbc:
If yearIsDateType configuration property is set to false, then the returned object type is java.sql.Short. If set to true (the default), then the returned object is of type java.sql.Date with the date set to January 1st, at midnight.
To compat with mysql, we force the use of yearIsDateType=false in FE. if user sets yearIsDateType=true, doris FE will force to change yearIsDateType=false.
2022-11-30 11:28:08 +08:00
82f3980774 [feature](Nereids) estimation without column statistics (#14526)
estimate plan cost without column statistics.
change list:
1. remove original StatsCalculator, it is replaced by StatsCalculatorV2. rename StatsCalculatorV2 to StatsCalculator
2. remove FilterSelectivityCalculator, it is replaced by FilterEstimation
3. remove session var:ENABLE_NEREIDS_STATS_DERIVE_V2
4. add ColumnStatistics.isUnKnown, which means the column is not analyzed, and its stats is not accurate.
5. add estimatedRowCount() function for OLAP tables
6. add unit tests for FilterEstimation and StatsCalculator
2022-11-30 11:27:51 +08:00
3a362fab76 [fix](fe)table function node use wrong info for projection (#14667) 2022-11-30 10:41:32 +08:00
ca90253b09 [config](storage-policy) add a FE config to disable storage policy by default (#14655)
the cold-hot separation feature is still
under development. And seems there are some unsolved feature remains.
So I add a fe config enable_storage_policy, and default is false, to disable the creation and usage of storage policy by default.

So that user can aware that he is using an experimental feature on his own, and it will not be released formally in v1.2.0.

Disable storage policy by default, user can not use or create storage policy. Configured by enable_storage_policy.

Remove property remote_storage_policy, it is duplicate with storage_policy

Change the persist field in DataProperty.java.
And remove remoteCooldownTime from DataProperty, because it can be got from StoragePolicy.
2022-11-30 10:04:33 +08:00
dd7ec8f4ca [improvement](test) add tpch1 orc for hive catalog and refactor some test dir (#14669)
Add tpch 1g orc test case in hive docker

Refactor some suites dir of catalog test cases.

And "-internal" for dlf endpoint, to support access oss with aliyun vpc.
2022-11-30 10:03:58 +08:00
4faca56819 [bug](jsonb) fix INSERT/CAST NULL to JSONB (#14682)
Add NULL -> JSONB in implicitCastMap to support INSERT/CAST NULL to JSONB.
2022-11-30 09:53:16 +08:00
d5ee721621 [improvement](planner)Adjust the field naming rules when creating tables (#14671)
Adjust the field naming rules when creating tables.

The original table field rules are letters or underscores or @ characters as the first letter,
followed by a maximum of 63 characters, and the total cannot exceed 64 characters.
However, in many industries, such as the financial industry, the length of the derived fields often exceeds 64 
characters, so adjust the regular The rules are from 64 characters to 128 characters.
Many users load data from Hive to Doris through appearance or BrokerLoad.
Arabic numerals can be used as the first letter in the Hive table, so the regular rules are adjusted
to support Arabic numerals as the first letter.
2022-11-30 09:45:27 +08:00