ZhangYu0123 opened a new pull request #4623:
URL: https://github.com/apache/incubator-doris/pull/4623
## Proposed changes
Main include:
(1)FE SQL syntax (Create table) support array type column, like:
CREATE TABLE array_test (
k1 tinyint(4) NOT NULL COMMENT "",
k2 smallint(6) NOT NULL COMMENT "",
k3 array<int(11)> NOT NULL COMMENT "",
k8 double MAX NOT NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(k1, k2, k3)
COMMENT "OLAP"
DISTRIBUTED BY HASH(k1) BUCKETS 5
PROPERTIES (
"storage_type" = "COLUMN",
"replication_num" = "1"
);
(2)FE SQL syntax support ArrayLiteral, support array related function, and
the array constucted function support sub-element type auto-cast, like :
// sub-element type is INT
mysql> select array(1, 2, 3);
+----------------+
| array(1, 2, 3) |
+----------------+
| [1, 2, 3] |
+----------------+
1 row in set (0.01 sec)
// the sub-element type is VARCHAR
mysql> select array(1, 2, 'a', 'xzcv');
+--------------------------+
| array(1, 2, 'a', 'xzcv') |
+--------------------------+
| ['1', '2', 'a', 'xzcv'] |
+--------------------------+
1 row in set (0.01 sec)
(3)FE update meta: Columns meta support array type, include meta serialized
and deserialized, and add flags in FEMetaVersions for compatibility
(4)BE update result buffer, support dynamic mode for output variable length
data type.
BE support ArrayLiteral and array(*) functions, like:
mysql> SELECT ARRAY(k1,k3) from test.bigtable;
+-------------------+
| array(`k1`, `k3`) |
+-------------------+
| [1, 1] |
| [3, 3] |
| [7, 7] |
| [6, 6] |
| [4, 4] |
| [2, 2] |
| [5, 5] |
| [8, 8] |
+-------------------+
8 rows in set (0.02 sec)
(5)merge BE storage code
## Types of changes
What types of changes does your code introduce to Doris?
_Put an `x` in the boxes that apply_
- [x] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [] Breaking change (fix or feature that would cause existing functionality
to not work as expected)
- [] Documentation Update (if none of the other choices apply)
- [] Code refactor (Modify the code structure, format the code, etc...)
## Checklist
_Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look for
before merging your code._
- [x] I have create an issue on (Fix #2871 ), and have described the
bug/feature there in detail
- [x] Compiling and unit tests pass locally with my changes
- [] I have added tests that prove my fix is effective or that my feature
works
- [] If this change need a document change, I have updated the document
- [] Any dependent changes have been merged
## Further comments
If this is a relatively large or complex change, kick off the discussion at
[email protected] by explaining why you chose the solution you did and what
alternatives you considered, etc...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]