This is an automated email from the ASF dual-hosted git repository.
zhangchen pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 6a99c550406 [Cherry-Pick](Branch-2.0) Pick some txn bug fix #26748
#27780 #33336" (#36248)
6a99c550406 is described below
commit 6a99c550406b71fc7f87914d4837674fc2b32237
Author: abmdocrt <[email protected]>
AuthorDate: Mon Jun 17 10:57:44 2024 +0800
[Cherry-Pick](Branch-2.0) Pick some txn bug fix #26748 #27780 #33336"
(#36248)
Pick #26748
Pick #27780
Pick #33336
---------
Co-authored-by: zhannngchen <[email protected]>
Co-authored-by: meiyi <[email protected]>
---
.../apache/doris/analysis/NativeInsertStmt.java | 54 ++++++--
.../doris/nereids/rules/analysis/BindSink.java | 58 ++++++--
.../java/org/apache/doris/qe/StmtExecutor.java | 20 +++
.../data_model_p0/unique/test_unique_table.out | 24 ++++
.../unique/test_unique_table_new_sequence.out | 15 +++
.../unique/test_unique_table_sequence.out | 19 ++-
.../data/point_query_p0/test_point_query.out | 147 +++++----------------
.../data_model_p0/unique/test_unique_table.groovy | 37 ++++++
.../unique/test_unique_table_new_sequence.groovy | 62 ++++++++-
.../unique/test_unique_table_sequence.groovy | 76 ++++++++++-
.../suites/point_query_p0/test_point_query.groovy | 9 +-
.../test_uniq_seq_col_schema_change.groovy | 2 +-
.../test_partial_update_seq_type.groovy | 8 +-
.../test_partial_update_seq_type_delete.groovy | 8 +-
14 files changed, 385 insertions(+), 154 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java
index 7f84dc54f6f..75e32ae0947 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java
@@ -231,6 +231,10 @@ public class NativeInsertStmt extends InsertStmt {
return tblName.getTbl();
}
+ public List<String> getTargetColumnNames() {
+ return targetColumnNames;
+ }
+
public void getTables(Analyzer analyzer, Map<Long, TableIf> tableMap,
Set<String> parentViewNameSet)
throws AnalysisException {
// get dbs of statement
@@ -409,16 +413,43 @@ public class NativeInsertStmt extends InsertStmt {
}
}
- if (olapTable.hasSequenceCol() && olapTable.getSequenceMapCol() !=
null && targetColumnNames != null) {
- Optional<String> foundCol = targetColumnNames.stream()
- .filter(c ->
c.equalsIgnoreCase(olapTable.getSequenceMapCol())).findAny();
- Optional<Column> seqCol = olapTable.getFullSchema().stream()
- .filter(col ->
col.getName().equals(olapTable.getSequenceMapCol()))
- .findFirst();
- if (seqCol.isPresent() && !foundCol.isPresent() &&
!isPartialUpdate && !isFromDeleteOrUpdateStmt
+ // For Unique Key table with sequence column (which default value
is not CURRENT_TIMESTAMP),
+ // user MUST specify the sequence column while inserting data
+ //
+ // case1: create table by `function_column.sequence_col`
+ // a) insert with column list, must include the sequence
map column
+ // b) insert without column list, already contains the
column, don't need to check
+ // case2: create table by `function_column.sequence_type`
+ // a) insert with column list, must include the hidden
column __DORIS_SEQUENCE_COL__
+ // b) insert without column list, don't include the hidden
column __DORIS_SEQUENCE_COL__
+ // by default, will fail.
+ if (olapTable.hasSequenceCol()) {
+ boolean haveInputSeqCol = false;
+ Optional<Column> seqColInTable = Optional.empty();
+ if (olapTable.getSequenceMapCol() != null) {
+ if (targetColumnNames != null) {
+ if (targetColumnNames.stream()
+ .anyMatch(c ->
c.equalsIgnoreCase(olapTable.getSequenceMapCol()))) {
+ haveInputSeqCol = true; // case1.a
+ }
+ } else {
+ haveInputSeqCol = true; // case1.b
+ }
+ seqColInTable = olapTable.getFullSchema().stream()
+ .filter(col ->
col.getName().equals(olapTable.getSequenceMapCol())).findFirst();
+ } else {
+ if (targetColumnNames != null) {
+ if (targetColumnNames.stream()
+ .anyMatch(c ->
c.equalsIgnoreCase(Column.SEQUENCE_COL))) {
+ haveInputSeqCol = true; // case2.a
+ } // else case2.b
+ }
+ }
+
+ if (!haveInputSeqCol && !isPartialUpdate &&
!isFromDeleteOrUpdateStmt
&&
!analyzer.getContext().getSessionVariable().isEnableUniqueKeyPartialUpdate()) {
- if (seqCol.get().getDefaultValue() == null
- ||
!seqCol.get().getDefaultValue().equals(DefaultValue.CURRENT_TIMESTAMP)) {
+ if (!seqColInTable.isPresent() ||
seqColInTable.get().getDefaultValue() == null
+ ||
!seqColInTable.get().getDefaultValue().equals(DefaultValue.CURRENT_TIMESTAMP)) {
throw new AnalysisException("Table " +
olapTable.getName()
+ " has sequence column, need to specify the
sequence column");
}
@@ -1087,4 +1118,9 @@ public class NativeInsertStmt extends InsertStmt {
slotDesc.setIsNullable(col.isAllowNull());
}
}
+
+ public boolean containTargetColumnName(String columnName) {
+ return targetColumnNames != null && targetColumnNames.stream()
+ .anyMatch(col -> col.equalsIgnoreCase(columnName));
+ }
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
index 0044a9ed185..c9c0954a2f2 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
@@ -103,18 +103,52 @@ public class BindSink implements AnalysisRuleFactory {
}
try {
- if (table.hasSequenceCol() &&
table.getSequenceMapCol() != null
- && !sink.getColNames().isEmpty()
&& !boundSink.isPartialUpdate()) {
- Column seqCol =
table.getFullSchema().stream()
- .filter(col ->
col.getName().equals(table.getSequenceMapCol()))
- .findFirst().get();
- Optional<String> foundCol =
sink.getColNames().stream()
- .filter(col ->
col.equals(table.getSequenceMapCol()))
- .findFirst();
- if (!foundCol.isPresent() &&
(seqCol.getDefaultValue() == null
- ||
!seqCol.getDefaultValue().equals(DefaultValue.CURRENT_TIMESTAMP))) {
- throw new AnalysisException("Table " +
table.getName()
- + " has sequence column, need to
specify the sequence column");
+ // For Unique Key table with sequence column
+ // (which default value is not
CURRENT_TIMESTAMP),
+ // user MUST specify the sequence column while
inserting data
+ //
+ // case1: create table by
`function_column.sequence_col`
+ // a) insert with column list, must
include the
+ // sequence map column
+ // b) insert without column list,
already contains the column,
+ // don't need to check
+ // case2: create table by
`function_column.sequence_type`
+ // a) insert with column list, must
include the hidden column
+ // __DORIS_SEQUENCE_COL__
+ // b) insert without column list, don't
include the hidden column
+ // __DORIS_SEQUENCE_COL__
+ // by default, will fail.
+ if (table.hasSequenceCol()) {
+ boolean haveInputSeqCol = false;
+ Optional<Column> seqColInTable =
Optional.empty();
+ if (table.getSequenceMapCol() != null) {
+ if (!sink.getColNames().isEmpty()) {
+ if
(sink.getColNames().contains(table.getSequenceMapCol())) {
+ haveInputSeqCol = true; //
case1.a
+ }
+ } else {
+ haveInputSeqCol = true; // case1.b
+ }
+ seqColInTable =
table.getFullSchema().stream()
+ .filter(col ->
col.getName().equals(table.getSequenceMapCol()))
+ .findFirst();
+ } else {
+ if (!sink.getColNames().isEmpty()) {
+ if
(sink.getColNames().contains(Column.SEQUENCE_COL)) {
+ haveInputSeqCol = true; //
case2.a
+ } // else case2.b
+ }
+ }
+
+ if (!haveInputSeqCol &&
!sink.isPartialUpdate()) {
+ if (!seqColInTable.isPresent() ||
seqColInTable.get().getDefaultValue() == null
+ ||
!seqColInTable.get().getDefaultValue()
+
.equals(DefaultValue.CURRENT_TIMESTAMP)) {
+ throw new
org.apache.doris.common.AnalysisException(
+ "Table " + table.getName()
+ + " has sequence
column, "
+ + "need to specify
the sequence column");
+ }
}
}
} catch (Exception e) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index a149db5c869..03ec39818b8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -1827,6 +1827,16 @@ public class StmtExecutor {
if (selectStmt.getValueList() != null) {
Table tbl = txnEntry.getTable();
int schemaSize = tbl.getBaseSchema(false).size();
+ if (parsedStmt instanceof NativeInsertStmt
+ && ((NativeInsertStmt) parsedStmt).getTargetColumnNames()
!= null) {
+ NativeInsertStmt nativeInsertStmt = (NativeInsertStmt)
parsedStmt;
+ if
(nativeInsertStmt.containTargetColumnName(Column.SEQUENCE_COL)) {
+ schemaSize++;
+ }
+ if
(nativeInsertStmt.containTargetColumnName(Column.DELETE_SIGN)) {
+ schemaSize++;
+ }
+ }
for (List<Expr> row : selectStmt.getValueList().getRows()) {
// the value columns are columns which are visible to user, so
here we use
// getBaseSchema(), not getFullSchema()
@@ -1900,6 +1910,16 @@ public class StmtExecutor {
.setMergeType(TMergeType.APPEND).setThriftRpcTimeoutMs(5000).setLoadId(context.queryId())
.setExecMemLimit(maxExecMemByte).setTimeout((int)
timeoutSecond)
.setTimezone(timeZone).setSendBatchParallelism(sendBatchParallelism);
+ if (parsedStmt instanceof NativeInsertStmt && ((NativeInsertStmt)
parsedStmt).getTargetColumnNames() != null) {
+ NativeInsertStmt nativeInsertStmt = (NativeInsertStmt) parsedStmt;
+ if (nativeInsertStmt.containTargetColumnName(Column.SEQUENCE_COL)
+ ||
nativeInsertStmt.containTargetColumnName(Column.DELETE_SIGN)) {
+ if
(nativeInsertStmt.containTargetColumnName(Column.SEQUENCE_COL)) {
+ request.setSequenceCol(Column.SEQUENCE_COL);
+ }
+ request.setColumns("`" + String.join("`,`",
nativeInsertStmt.getTargetColumnNames()) + "`");
+ }
+ }
// execute begin txn
InsertStreamTxnExecutor executor = new
InsertStreamTxnExecutor(txnEntry);
diff --git a/regression-test/data/data_model_p0/unique/test_unique_table.out
b/regression-test/data/data_model_p0/unique/test_unique_table.out
index ccc1edc3569..6e4a7ec0e76 100644
--- a/regression-test/data/data_model_p0/unique/test_unique_table.out
+++ b/regression-test/data/data_model_p0/unique/test_unique_table.out
@@ -8,3 +8,27 @@ int_value INT Yes false \N REPLACE
char_value CHAR(10) Yes false \N REPLACE
date_value DATE Yes false \N REPLACE
+-- !0 --
+k1 INT Yes true \N
+v1 TINYINT Yes false \N REPLACE
+v2 INT Yes false \N REPLACE
+v3 INT Yes false \N REPLACE
+or INT Yes false \N REPLACE
+__DORIS_DELETE_SIGN__ TINYINT No false 0 REPLACE
+__DORIS_VERSION_COL__ BIGINT No false 0 REPLACE
+
+-- !1 --
+1 1 1 1 1 0 2
+2 2 2 2 2 0 2
+3 3 3 3 3 0 2
+
+-- !2 --
+1 1 1 1 1 0 2
+2 20 20 20 20 0 3
+3 3 3 3 3 0 2
+
+-- !3 --
+1 1 1 1 1 0 2
+2 20 20 20 20 0 3
+3 30 30 30 30 1 4
+
diff --git
a/regression-test/data/data_model_p0/unique/test_unique_table_new_sequence.out
b/regression-test/data/data_model_p0/unique/test_unique_table_new_sequence.out
index d4b4f93af95..c8acc992a0c 100644
---
a/regression-test/data/data_model_p0/unique/test_unique_table_new_sequence.out
+++
b/regression-test/data/data_model_p0/unique/test_unique_table_new_sequence.out
@@ -55,3 +55,18 @@ __DORIS_DELETE_SIGN__ TINYINT No false 0
REPLACE
__DORIS_VERSION_COL__ BIGINT No false 0 REPLACE
__DORIS_SEQUENCE_COL__ INT Yes false \N REPLACE
+-- !1 --
+1 1 1 1 1 0 2 1
+2 2 2 2 2 0 2 2
+3 3 3 3 3 0 2 3
+
+-- !2 --
+1 1 1 1 1 0 2 1
+2 20 20 20 20 0 3 20
+3 3 3 3 3 0 2 3
+
+-- !3 --
+1 1 1 1 1 0 2 1
+2 20 20 20 20 0 3 20
+3 3 3 3 3 0 2 3
+
diff --git
a/regression-test/data/data_model_p0/unique/test_unique_table_sequence.out
b/regression-test/data/data_model_p0/unique/test_unique_table_sequence.out
index 2be696b86e5..4f1d633250d 100644
--- a/regression-test/data/data_model_p0/unique/test_unique_table_sequence.out
+++ b/regression-test/data/data_model_p0/unique/test_unique_table_sequence.out
@@ -35,13 +35,28 @@
-- !part --
1 10 15
-15 9 18
+15 8 19
2 5 14
3 6 11
-- !all --
1 10 15 16 17 0 4 15
-15 9 18 21 22 0 8 \N
+15 8 19 20 21 0 7 3
2 5 14 13 14 0 5 12
3 6 11 14 15 0 6 13
+-- !1 --
+1 1 1 1 1 0 2 1
+2 2 2 2 2 0 2 2
+3 3 3 3 3 0 2 3
+
+-- !2 --
+1 1 1 1 1 0 2 1
+2 20 20 20 20 0 3 20
+3 3 3 3 3 0 2 3
+
+-- !3 --
+1 1 1 1 1 0 2 1
+2 20 20 20 20 0 3 20
+3 3 3 3 3 0 2 3
+
diff --git a/regression-test/data/point_query_p0/test_point_query.out
b/regression-test/data/point_query_p0/test_point_query.out
index ff4b1932b3a..01f6310d595 100644
--- a/regression-test/data/point_query_p0/test_point_query.out
+++ b/regression-test/data/point_query_p0/test_point_query.out
@@ -1,27 +1,27 @@
-- This file is automatically generated. You should know what you did if you
want to edit this
-- !point_select --
-1231 119291.110000000 ddd laooq \N 2020-01-01 12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
+1231 119291.110000000 ddd laooq \N 2020-01-01T12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
-- !point_select --
-1231 119291.110000000 ddd laooq \N 2020-01-01 12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
+1231 119291.110000000 ddd laooq \N 2020-01-01T12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
-- !point_select --
-1237 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 90696620686827832.374
[1.100000000, 2.200000000, 3.300000000, 4.400000000, 5.500000000] []
+1237 120939.111300000 a ddd laooq 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 90696620686827832.374
[1.100000000, 2.200000000, 3.300000000, 4.400000000, 5.500000000] []
-- !point_select --
-1232 12222.991211350 xxx laooq 2023-01-02 2020-01-01 12:36:38
522.762 2022-01-01 true 212.111 \N \N
+1232 12222.991211350 xxx laooq 2023-01-02 2020-01-01T12:36:38
522.762 2022-01-01 true 212.111 \N \N
-- !point_select --
-251 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 251.0 7022-01-01
true 90696620686827832.374 [11111.000000000] []
+251 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01T12:36:38 251.0 7022-01-01
true 90696620686827832.374 [11111.000000000] []
-- !point_select --
-252 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 252.0 7022-01-01
false 90696620686827832.374 \N [0.000000000]
+252 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01T12:36:38 252.0 7022-01-01
false 90696620686827832.374 \N [0.000000000]
-- !point_select --
-298 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 298.0 7022-01-01
true 90696620686827832.374 [] []
+298 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01T12:36:38 298.0 7022-01-01
true 90696620686827832.374 [] []
-- !point_select --
-1235 991129292901.111380000 dd \N 2120-01-02 2020-01-01
12:36:38 652.692 5022-01-01 false 90696620686827832.374
[119181.111100000]
["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]
+1235 991129292901.111380000 dd \N 2120-01-02
2020-01-01T12:36:38 652.692 5022-01-01 false 90696620686827832.374
[119181.111100000]
["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]
-- !point_select --
646464 6C616F6F71
@@ -33,34 +33,34 @@
646464 6C616F6F71
-- !point_select --
-1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
+1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
-- !point_select --
-1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
+1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-- !sql --
1231 119291.110000000 ddd laooq \N 2020-01-01T12:36:38
\N 1022-01-01 \N 1.111 [119181.111100000, 819019.119100000,
null] \N 0 0
@@ -75,28 +75,28 @@
0 1 2 3
-- !point_select --
-1231 119291.110000000 ddd laooq \N 2020-01-01 12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
+1231 119291.110000000 ddd laooq \N 2020-01-01T12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
-- !point_select --
-1231 119291.110000000 ddd laooq \N 2020-01-01 12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
+1231 119291.110000000 ddd laooq \N 2020-01-01T12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
-- !point_select --
-1237 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 90696620686827832.374
[1.100000000, 2.200000000, 3.300000000, 4.400000000, 5.500000000] []
+1237 120939.111300000 a ddd laooq 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 90696620686827832.374
[1.100000000, 2.200000000, 3.300000000, 4.400000000, 5.500000000] []
-- !point_select --
-1232 12222.991211350 xxx laooq 2023-01-02 2020-01-01 12:36:38
522.762 2022-01-01 true 212.111 \N \N
+1232 12222.991211350 xxx laooq 2023-01-02 2020-01-01T12:36:38
522.762 2022-01-01 true 212.111 \N \N
-- !point_select --
-251 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 251.0 7022-01-01
true 90696620686827832.374 [11111.000000000] []
+251 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01T12:36:38 251.0 7022-01-01
true 90696620686827832.374 [11111.000000000] []
-- !point_select --
-252 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 252.0 7022-01-01
false 90696620686827832.374 \N [0.000000000]
+252 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01T12:36:38 252.0 7022-01-01
false 90696620686827832.374 \N [0.000000000]
-- !point_select --
-298 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 298.0 7022-01-01
true 90696620686827832.374 [] []
+298 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01T12:36:38 298.0 7022-01-01
true 90696620686827832.374 [] []
-- !point_select --
-1235 991129292901.111380000 dd \N 2120-01-02 2020-01-01
12:36:38 652.692 5022-01-01 false 90696620686827832.374
[119181.111100000]
["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]
+1235 991129292901.111380000 dd \N 2120-01-02
2020-01-01T12:36:38 652.692 5022-01-01 false 90696620686827832.374
[119181.111100000]
["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]
-- !point_select --
646464 6C616F6F71
@@ -108,109 +108,34 @@
646464 6C616F6F71
-- !point_select --
-1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
+1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
-- !point_select --
-1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
+1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-
--- !sql --
-1231 119291.110000000 ddd laooq \N 2020-01-01T12:36:38
\N 1022-01-01 \N 1.111 [119181.111100000, 819019.119100000,
null] \N 0 0
-
--- !sql --
-1237 120939.111300000 a ddd laooq 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 90696620686827832.374
[1.100000000, 2.200000000, 3.300000000, 4.400000000, 5.500000000] []
0 0
-
--- !sql --
-6120202020646464 6C616F6F71 32.92200050354004
-
--- !sql --
-0 1 2 3
-
--- !point_select --
-1231 119291.110000000 ddd laooq \N 2020-01-01 12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
-
--- !point_select --
-1231 119291.110000000 ddd laooq \N 2020-01-01 12:36:38
\N 1022-01-01 \N 1.111 \N [119181.111100000,
819019.119100000, null]
-
--- !point_select --
-1237 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 90696620686827832.374
[1.100000000, 2.200000000, 3.300000000, 4.400000000, 5.500000000] []
-
--- !point_select --
-1232 12222.991211350 xxx laooq 2023-01-02 2020-01-01 12:36:38
522.762 2022-01-01 true 212.111 \N \N
-
--- !point_select --
-251 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 251.0 7022-01-01
true 90696620686827832.374 [11111.000000000] []
-
--- !point_select --
-252 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 252.0 7022-01-01
false 90696620686827832.374 \N [0.000000000]
-
--- !point_select --
-298 120939.111300000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
laooq 2030-01-02 2020-01-01 12:36:38 298.0 7022-01-01
true 90696620686827832.374 [] []
-
--- !point_select --
-1235 991129292901.111380000 dd \N 2120-01-02 2020-01-01
12:36:38 652.692 5022-01-01 false 90696620686827832.374
[119181.111100000]
["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]
-
--- !point_select --
-646464 6C616F6F71
-
--- !point_select --
-646464 6C616F6F71
-
--- !point_select --
-646464 6C616F6F71
-
--- !point_select --
-1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
-
--- !point_select --
-1235 120939.111300000 a ddd laooq 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 true 1.111
[119291.192910000] ["111", "222", "333"] 1
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2
-
--- !point_select --
-1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01 12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
+1235 120939.111300000 a ddd xxxxxx 2030-01-02
2020-01-01T12:36:38 22.822 7022-01-01 false 1929111.111
[119291.192910000] ["111", "222", "333"] 2 0
-- !sql --
1231 119291.110000000 ddd laooq \N 2020-01-01T12:36:38
\N 1022-01-01 \N 1.111 [119181.111100000, 819019.119100000,
null] \N 0 0
diff --git
a/regression-test/suites/data_model_p0/unique/test_unique_table.groovy
b/regression-test/suites/data_model_p0/unique/test_unique_table.groovy
index eb9bd2b57d7..f6d5613c4e8 100644
--- a/regression-test/suites/data_model_p0/unique/test_unique_table.groovy
+++ b/regression-test/suites/data_model_p0/unique/test_unique_table.groovy
@@ -42,4 +42,41 @@ suite("test_unique_table") {
order_qt_select_uniq_table "select * from ${tbName}"
qt_desc_uniq_table "desc ${tbName}"
sql "DROP TABLE ${tbName}"
+
+ sql "DROP TABLE IF EXISTS ${tbName}"
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tbName} (
+ `k1` int NULL,
+ `v1` tinyint NULL,
+ `v2` int,
+ `v3` int,
+ `or` int
+ ) ENGINE=OLAP
+ UNIQUE KEY(k1)
+ DISTRIBUTED BY HASH(`k1`) BUCKETS 3
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+ sql "SET show_hidden_columns=true"
+ qt_0 "desc ${tbName}"
+ sql "begin;"
+ sql "insert into ${tbName} (k1, v1, v2, v3, `or`, __doris_delete_sign__)
values (1,1,1,1,1,0),(2,2,2,2,2,0),(3,3,3,3,3,0);"
+ sql "commit;"
+
+ qt_1 "select * from ${tbName} order by k1;"
+
+ sql "begin;"
+ sql "insert into ${tbName} (k1, v1, v2, v3, `or`, __DORIS_DELETE_SIGN__)
values (2,20,20,20,20,0);"
+ sql "commit;"
+
+ qt_2 "select * from ${tbName} order by k1;"
+
+ sql "begin;"
+ sql "insert into ${tbName} (k1, v1, v2, v3, `or`, __DORIS_DELETE_SIGN__)
values (3,30,30,30,30,1);"
+ sql "commit;"
+
+ qt_3 "select * from ${tbName} order by k1"
+
+ sql "DROP TABLE ${tbName}"
}
diff --git
a/regression-test/suites/data_model_p0/unique/test_unique_table_new_sequence.groovy
b/regression-test/suites/data_model_p0/unique/test_unique_table_new_sequence.groovy
index 82c4ec0bc16..861c6878e17 100644
---
a/regression-test/suites/data_model_p0/unique/test_unique_table_new_sequence.groovy
+++
b/regression-test/suites/data_model_p0/unique/test_unique_table_new_sequence.groovy
@@ -34,7 +34,7 @@ suite("test_unique_table_new_sequence") {
"light_schema_change" = "true"
);
"""
- // load unique key
+ // test streamload with seq col
streamLoad {
table "${tableName}"
@@ -60,7 +60,7 @@ suite("test_unique_table_new_sequence") {
sql "sync"
order_qt_all "SELECT * from ${tableName}"
- // load unique key
+ // test update data, using streamload with seq col
streamLoad {
table "${tableName}"
@@ -105,9 +105,17 @@ suite("test_unique_table_new_sequence") {
order_qt_all "SELECT * from ${tableName}"
+ // test insert into with column list, which not contains the seq mapping
column v2
+ test {
+ sql "INSERT INTO ${tableName} (k1, v1, v3, v4) values(15, 8, 20, 21)"
+ exception "Table ${tableName} has sequence column, need to specify the
sequence column"
+ }
+
+ // test insert into without column list
sql "INSERT INTO ${tableName} values(15, 8, 19, 20, 21)"
- sql "INSERT INTO ${tableName} values(15, 9, 18, 21, 22)"
+ // test insert into with column list
+ sql "INSERT INTO ${tableName} (k1, v1, v2, v3, v4) values(15, 9, 18, 21,
22)"
sql "SET show_hidden_columns=true"
@@ -122,5 +130,53 @@ suite("test_unique_table_new_sequence") {
qt_desc "desc ${tableName}"
sql "DROP TABLE ${tableName}"
+
+ sql """ DROP TABLE IF EXISTS ${tableName} """
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tableName} (
+ `k1` int NULL,
+ `v1` tinyint NULL,
+ `v2` int,
+ `v3` int,
+ `v4` int
+ ) ENGINE=OLAP
+ UNIQUE KEY(k1)
+ DISTRIBUTED BY HASH(`k1`) BUCKETS 3
+ PROPERTIES (
+ "function_column.sequence_col" = "v4",
+ "replication_allocation" = "tag.location.default: 1",
+ "light_schema_change" = "true"
+ );
+ """
+
+ // test insert into with column list, which not contains the seq mapping
column v4
+ // in begin/commit
+ sql "begin;"
+ test {
+ sql "INSERT INTO ${tableName} (k1, v1, v2, v3) values(1,1,1,1)"
+ exception "Table ${tableName} has sequence column, need to specify the
sequence column"
+ }
+ sql "commit;"
+
+ // test insert into without column list, in begin/commit
+ sql "begin;"
+ sql "insert into ${tableName} values (1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3);"
+ sql "commit;"
+
+ qt_1 "select * from ${tableName} order by k1;"
+
+ sql "begin;"
+ sql "insert into ${tableName} (k1, v1, v2, v3, v4) values (2,20,20,20,20);"
+ sql "commit;"
+
+ qt_2 "select * from ${tableName} order by k1;"
+
+ sql "begin;"
+ sql "insert into ${tableName} (k1, v1, v2, v3, v4) values (3,30,30,30,1);"
+ sql "commit;"
+
+ qt_3 "select * from ${tableName} order by k1"
+
+ sql "DROP TABLE ${tableName}"
}
diff --git
a/regression-test/suites/data_model_p0/unique/test_unique_table_sequence.groovy
b/regression-test/suites/data_model_p0/unique/test_unique_table_sequence.groovy
index 3753391f942..c5898480f0d 100644
---
a/regression-test/suites/data_model_p0/unique/test_unique_table_sequence.groovy
+++
b/regression-test/suites/data_model_p0/unique/test_unique_table_sequence.groovy
@@ -33,7 +33,7 @@ suite("test_unique_table_sequence") {
"replication_allocation" = "tag.location.default: 1"
);
"""
- // load unique key
+ // test streamload with seq col
streamLoad {
table "${tableName}"
@@ -60,7 +60,7 @@ suite("test_unique_table_sequence") {
sql "sync"
order_qt_all "SELECT * from ${tableName}"
- // load unique key
+ // test update data, using streamload with seq col
streamLoad {
table "${tableName}"
@@ -92,6 +92,7 @@ suite("test_unique_table_sequence") {
order_qt_all "SELECT * from ${tableName}"
+ // test update on table with seq col
sql "UPDATE ${tableName} SET v1 = 10 WHERE k1 = 1"
sql "UPDATE ${tableName} SET v2 = 14 WHERE k1 = 2"
@@ -106,9 +107,22 @@ suite("test_unique_table_sequence") {
order_qt_all "SELECT * from ${tableName}"
- sql "INSERT INTO ${tableName} values(15, 8, 19, 20, 21)"
+ // test insert into without column list
+ test {
+ sql "INSERT INTO ${tableName} values(15, 8, 19, 20, 21)"
+ exception "Table ${tableName} has sequence column, need to specify the
sequence column"
+ }
+
+ // test insert into with column list
+ test {
+ sql "INSERT INTO ${tableName} (k1, v1, v2, v3, v4) values(15, 8, 19,
20, 21)"
+ exception "Table ${tableName} has sequence column, need to specify the
sequence column"
+ }
- sql "INSERT INTO ${tableName} values(15, 9, 18, 21, 22)"
+ // correct way of insert into with seq col
+ sql "INSERT INTO ${tableName} (k1, v1, v2, v3, v4, __DORIS_SEQUENCE_COL__)
values(15, 8, 19, 20, 21, 3)"
+
+ sql "INSERT INTO ${tableName} (k1, v1, v2, v3, v4, __DORIS_SEQUENCE_COL__)
values(15, 9, 18, 21, 22, 2)"
sql "SET show_hidden_columns=true"
@@ -121,5 +135,59 @@ suite("test_unique_table_sequence") {
order_qt_all "SELECT * from ${tableName}"
sql "DROP TABLE ${tableName}"
+
+ sql "DROP TABLE IF EXISTS ${tableName}"
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tableName} (
+ `k1` int NULL,
+ `v1` tinyint NULL,
+ `v2` int,
+ `v3` int,
+ `v4` int
+ ) ENGINE=OLAP
+ UNIQUE KEY(k1)
+ DISTRIBUTED BY HASH(`k1`) BUCKETS 3
+ PROPERTIES (
+ "function_column.sequence_type" = "int",
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+
+ // test insert into without column list, in begin/commit
+ sql "begin;"
+ test {
+ sql "INSERT INTO ${tableName} values(15, 8, 19, 20, 21)"
+ exception "Table ${tableName} has sequence column, need to specify the
sequence column"
+ }
+ sql "commit;"
+
+ // test insert into with column list, in begin/commit
+ sql "begin;"
+ test {
+ sql "INSERT INTO ${tableName} (k1, v1, v2, v3, v4) values(15, 8, 19,
20, 21)"
+ exception "Table ${tableName} has sequence column, need to specify the
sequence column"
+ }
+ sql "commit;"
+
+ sql "begin;"
+ sql "insert into ${tableName} (k1, v1, v2, v3, v4, __DORIS_SEQUENCE_COL__)
values (1,1,1,1,1,1),(2,2,2,2,2,2),(3,3,3,3,3,3);"
+ sql "commit;"
+
+ qt_1 "select * from ${tableName} order by k1;"
+
+ sql "begin;"
+ sql "insert into ${tableName} (k1, v1, v2, v3, v4, __DORIS_SEQUENCE_COL__)
values (2,20,20,20,20,20);"
+ sql "commit;"
+
+ qt_2 "select * from ${tableName} order by k1;"
+
+ sql "begin;"
+ sql "insert into ${tableName} (k1, v1, v2, v3, v4, __DORIS_SEQUENCE_COL__)
values (3,30,30,30,30,1);"
+ sql "commit;"
+
+ qt_3 "select * from ${tableName} order by k1"
+
+ sql "DROP TABLE ${tableName}"
+
}
diff --git a/regression-test/suites/point_query_p0/test_point_query.groovy
b/regression-test/suites/point_query_p0/test_point_query.groovy
index 4933ec32401..0b634de7556 100644
--- a/regression-test/suites/point_query_p0/test_point_query.groovy
+++ b/regression-test/suites/point_query_p0/test_point_query.groovy
@@ -115,18 +115,15 @@ suite("test_point_query") {
""", property)
}
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < 2; i++) {
tableName = realDb + ".tbl_point_query" + i
sql """DROP TABLE IF EXISTS ${tableName}"""
if (i == 0) {
def sql0 = create_table_sql("")
sql """ ${sql0} """
- } else if (i == 1) {
- def sql1 = create_table_sql("\"function_column.sequence_type\"
= 'int',")
- sql """ ${sql1} """
} else {
- def sql2 = create_table_sql("\"function_column.sequence_col\"
= 'k6',")
- sql """ ${sql2} """
+ def sql1 = create_table_sql("\"function_column.sequence_col\"
= 'k6',")
+ sql """ ${sql1} """
}
sql """ INSERT INTO ${tableName} VALUES(1231, 119291.11, "ddd",
"laooq", null, "2020-01-01 12:36:38", null, "1022-01-01 11:30:38", null,
1.111112, [119181.1111, 819019.1191, null], null) """
sql """ INSERT INTO ${tableName} VALUES(1232, 12222.99121135,
"xxx", "laooq", "2023-01-02", "2020-01-01 12:36:38", 522.762, "2022-01-01
11:30:38", 1, 212.111, null, null) """
diff --git
a/regression-test/suites/schema_change_p0/test_uniq_seq_col_schema_change.groovy
b/regression-test/suites/schema_change_p0/test_uniq_seq_col_schema_change.groovy
index be3bc102568..f94eab3822b 100644
---
a/regression-test/suites/schema_change_p0/test_uniq_seq_col_schema_change.groovy
+++
b/regression-test/suites/schema_change_p0/test_uniq_seq_col_schema_change.groovy
@@ -50,7 +50,7 @@ suite("test_uniq_seq_col_schema_change", "schema_change") {
sql "insert into ${tbName1}
${columnWithHidden_2}values(5,5,5,5,5,0,5);"
sql "insert into ${tbName1}
${columnWithHidden_2}values(5,6,6,6,6,0,6);"
- sql "insert into ${tbName1} values(5,6,6,7,6);"
+ sql "insert into ${tbName1}
${columnWithHidden_2}values(5,6,6,7,6,0,4);"
qt_sql "select * from ${tbName1} order by k1;"
sql "insert into ${tbName1}
${columnWithHidden_2}values(5,6,6,7,6,0,7);"
qt_sql "select * from ${tbName1} order by k1;"
diff --git
a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type.groovy
b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type.groovy
index 57eaf7c7f79..d7d55725df6 100644
---
a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type.groovy
+++
b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type.groovy
@@ -47,9 +47,11 @@ suite("test_primary_key_partial_update_seq_type", "p0") {
"store_row_column" = "${use_row_store}"); """
// insert 2 lines
sql """
- insert into ${tableName} values
- (2, "doris2", 2000, 223, 1, '2023-01-01'),
- (1, "doris", 1000, 123, 1, '2023-01-01')
+ insert into ${tableName}
+ (id, name, score, test, dft, update_time,
__DORIS_SEQUENCE_COL__)
+ values
+ (2, "doris2", 2000, 223, 1, '2023-01-01', 1),
+ (1, "doris", 1000, 123, 1, '2023-01-01', 1)
"""
sql "sync"
diff --git
a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type_delete.groovy
b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type_delete.groovy
index 23ef1a5dfbb..6ad60e0cd75 100644
---
a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type_delete.groovy
+++
b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_type_delete.groovy
@@ -47,9 +47,11 @@ suite("test_primary_key_partial_update_seq_type_delete",
"p0") {
"store_row_column" = "${use_row_store}"); """
// insert 2 lines
sql """
- insert into ${tableName} values
- (2, "doris2", 2000, 223, 1, '2023-01-01'),
- (1, "doris", 1000, 123, 1, '2023-01-01')
+ insert into ${tableName}
+ (id, name, score, test, dft, update_time,
__DORIS_SEQUENCE_COL__)
+ values
+ (2, "doris2", 2000, 223, 1, '2023-01-01', 1),
+ (1, "doris", 1000, 123, 1, '2023-01-01', 1)
"""
sql "sync"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]