You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "XieJiann (via GitHub)" <gi...@apache.org> on 2024/01/08 07:12:23 UTC
[PR] [feat](Nereids): suppory show constraint command [doris]
XieJiann opened a new pull request, #29667:
URL: https://github.com/apache/doris/pull/29667
## Proposed changes
Issue Number: close #xxx
<!--Describe your changes.-->
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) 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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): suppory show constraint command [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1880502455
<details>
<summary>TPC-H: <b>Total hot run time: 39185 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 8768ed7f5882730ceb5f6b07d185564f3a45d2a8, data reload: false
------ Round 1 ----------------------------------
q1 17661 5011 4988 4988
q2 2030 157 146 146
q3 10809 1157 1176 1157
q4 10530 858 870 858
q5 7789 2960 3031 2960
q6 210 126 125 125
q7 930 519 517 517
q8 9285 2007 2017 2007
q9 6460 6437 6439 6437
q10 8334 3070 3016 3016
q11 429 229 214 214
q12 386 230 227 227
q13 17992 3394 3389 3389
q14 233 208 204 204
q15 551 514 506 506
q16 486 406 386 386
q17 963 720 631 631
q18 7423 6828 6793 6793
q19 1582 1565 1553 1553
q20 678 334 323 323
q21 2778 2461 2435 2435
q22 355 313 322 313
Total cold run time: 107894 ms
Total hot run time: 39185 ms
----- Round 2, with runtime_filter_mode=off -----
q1 4942 4940 4976 4940
q2 350 246 240 240
q3 3308 3321 3301 3301
q4 2113 2001 2012 2001
q5 5825 5817 5819 5817
q6 210 117 118 117
q7 2324 1915 1917 1915
q8 3394 3451 3492 3451
q9 8881 8745 8766 8745
q10 3815 3852 3854 3852
q11 554 450 443 443
q12 813 636 636 636
q13 5629 3196 3189 3189
q14 294 250 272 250
q15 543 497 493 493
q16 541 501 496 496
q17 1900 1863 1870 1863
q18 8589 8437 8314 8314
q19 1628 1643 1624 1624
q20 2198 1944 1947 1944
q21 5677 5406 5306 5306
q22 510 477 459 459
Total cold run time: 64038 ms
Total hot run time: 59396 ms
```
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1882531584
PR approved by at least one committer and no changes requested.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): suppory show constraint command [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1880513432
<details>
<summary>TPC-DS: <b>Total hot run time: 185108 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 8768ed7f5882730ceb5f6b07d185564f3a45d2a8, data reload: false
run tpcds-sf100 query with default conf and session variables
query1 862 347 340 340
query2 4788 1952 1911 1911
query3 5179 224 222 222
query4 25825 22490 22448 22448
query5 4603 620 629 620
query6 319 211 200 200
query7 4206 317 300 300
query8 269 221 226 221
query9 8076 2959 3008 2959
query10 545 333 323 323
query11 15809 15744 15624 15624
query12 162 106 106 106
query13 1615 346 350 346
query14 11570 7686 7690 7686
query15 267 224 218 218
query16 6204 349 333 333
query17 1507 529 522 522
query18 1872 298 310 298
query19 239 168 167 167
query20 105 105 101 101
query21 163 91 95 91
query22 4827 4832 4821 4821
query23 32213 31674 31628 31628
query24 11326 2970 2958 2958
query25 611 365 366 365
query26 1564 163 180 163
query27 2924 316 309 309
query28 6441 2184 2162 2162
query29 1665 422 426 422
query30 281 144 150 144
query31 1025 806 824 806
query32 141 88 86 86
query33 814 341 345 341
query34 866 492 480 480
query35 992 875 860 860
query36 1481 1271 1254 1254
query37 184 91 87 87
query38 3486 3335 3386 3335
query39 1374 1308 1309 1308
query40 285 91 92 91
query41 40 37 37 37
query42 111 107 107 107
query43 547 533 518 518
query44 1186 806 819 806
query45 213 201 219 201
query46 1071 719 699 699
query47 1701 1609 1651 1609
query48 384 302 288 288
query49 1157 311 307 307
query50 799 362 353 353
query51 5518 5406 5348 5348
query52 114 98 103 98
query53 241 168 175 168
query54 1182 671 684 671
query55 109 97 97 97
query56 263 253 276 253
query57 1025 951 963 951
query58 324 271 283 271
query59 3005 2891 2755 2755
query60 353 300 299 299
query61 159 151 160 151
query62 575 508 516 508
query63 199 183 161 161
query64 5295 1750 1746 1746
query65 3421 3357 3348 3348
query66 1320 402 388 388
query67 15859 15508 15498 15498
query68 13126 570 573 570
query69 637 326 344 326
query70 1754 1699 1545 1545
query71 605 280 302 280
query72 5637 3478 3472 3472
query73 2627 345 349 345
query74 7118 6589 6589 6589
query75 5309 2257 2263 2257
query76 6303 1000 1214 1000
query77 786 337 314 314
query78 9089 8517 8555 8517
query79 1289 534 524 524
query80 560 346 345 345
query81 468 214 219 214
query82 232 109 118 109
query83 188 152 145 145
query84 255 61 58 58
query85 932 320 284 284
query86 443 454 447 447
query87 3633 3528 3483 3483
query88 2986 2498 2514 2498
query89 378 297 280 280
query90 2020 255 230 230
query91 127 96 97 96
query92 91 83 68 68
query93 1438 438 441 438
query94 955 256 245 245
query95 560 513 499 499
query96 640 339 344 339
query97 4340 4230 4240 4230
query98 245 230 216 216
query99 1126 887 853 853
Total cold run time: 288753 ms
Total hot run time: 185108 ms
```
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "xzj7019 (via GitHub)" <gi...@apache.org>.
xzj7019 commented on code in PR #29667:
URL: https://github.com/apache/doris/pull/29667#discussion_r1445608000
##########
regression-test/suites/nereids_syntax_p0/constraint.groovy:
##########
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("show_constraint") {
+ sql "SET enable_nereids_planner=true"
+ sql "SET enable_fallback_to_original_planner=false"
+
+ sql """ DROP TABLE IF EXISTS `t1` """
+ sql """
+ CREATE TABLE `t1` (
+ `id` varchar(64) NULL,
+ `name` varchar(64) NULL,
+ `age` int NULL
+ ) ENGINE=OLAP
+ DUPLICATE KEY(`id`,`name`)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(`id`,`name`) BUCKETS 4
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1",
+ "in_memory" = "false",
+ "storage_format" = "V2",
+ "disable_auto_compaction" = "false"
+ );
+ """
+
+ sql """
+ alter table t1 add constraint pk primary key (id)
+ """
+
Review Comment:
pls add case to show multiple fk reference for self or other table
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): suppory show constraint command [doris]
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1880483922
run buildall
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): suppory show constraint command [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1880516361
(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 47.77 seconds
stream load tsv: 573 seconds loaded 74807831229 Bytes, about 124 MB/s
stream load json: 19 seconds loaded 2358488459 Bytes, about 118 MB/s
stream load orc: 66 seconds loaded 1101869774 Bytes, about 15 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 27.2 seconds inserted 10000000 Rows, about 367K ops/s
storage size: 17188962479 Bytes
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1882399727
run buildall
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "xzj7019 (via GitHub)" <gi...@apache.org>.
xzj7019 commented on code in PR #29667:
URL: https://github.com/apache/doris/pull/29667#discussion_r1445606059
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowConstraintCommand.java:
##########
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands;
+
+import org.apache.doris.catalog.TableIf;
+import org.apache.doris.nereids.trees.plans.PlanType;
+import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
+import org.apache.doris.nereids.util.RelationUtil;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.StmtExecutor;
+
+import org.apache.hadoop.util.Lists;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * add constraint command
+ */
+public class ShowConstraintCommand extends Command implements NoForward {
+
+ public static final Logger LOG = LogManager.getLogger(ShowConstraintCommand.class);
+ private final List<String> nameParts;
+
+ /**
+ * constructor
+ */
+ public ShowConstraintCommand(List<String> nameParts) {
+ super(PlanType.SHOW_CONSTRAINT_COMMAND);
+ this.nameParts = nameParts;
+ }
+
+ @Override
+ public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
+ TableIf tableIf = RelationUtil.getDbAndTable(
+ RelationUtil.getQualifierName(ctx, nameParts), ctx.getEnv()).value();
+ List<List<String>> res = tableIf.getConstraintMap().entrySet().stream()
+ .map(e -> Lists.newArrayList(e.getKey(),
+ e.getValue().getClass().getSimpleName(),
Review Comment:
Is it better to normalize the type name to "PRIMARY KEY/UNIQUE KEY/FOREIGN KEY" 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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1882402809
PR approved by anyone and no changes requested.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow merged PR #29667:
URL: https://github.com/apache/doris/pull/29667
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1882422156
<details>
<summary>TPC-DS: <b>Total hot run time: 183569 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 2a3c6931763524a0be018c6b241a602e9e603abc, data reload: false
run tpcds-sf100 query with default conf and session variables
query1 878 345 342 342
query2 4954 1937 1898 1898
query3 5265 221 219 219
query4 25414 22340 22346 22340
query5 4598 645 603 603
query6 314 193 205 193
query7 4188 308 298 298
query8 239 230 230 230
query9 7697 2912 2913 2912
query10 512 382 327 327
query11 16281 15544 15574 15544
query12 154 112 103 103
query13 1554 329 336 329
query14 12383 7666 7632 7632
query15 269 235 217 217
query16 6280 337 335 335
query17 1395 526 513 513
query18 1916 303 299 299
query19 223 167 167 167
query20 105 101 103 101
query21 165 102 94 94
query22 4879 4799 4829 4799
query23 32123 31374 30952 30952
query24 11581 2926 2926 2926
query25 584 366 365 365
query26 1620 168 180 168
query27 2787 318 316 316
query28 6407 2167 2056 2056
query29 1730 412 423 412
query30 284 146 149 146
query31 1034 827 824 824
query32 137 83 84 83
query33 803 360 350 350
query34 866 458 477 458
query35 1002 908 867 867
query36 1364 1295 1258 1258
query37 171 91 90 90
query38 3531 3362 3382 3362
query39 1510 1448 1461 1448
query40 282 88 86 86
query41 38 38 35 35
query42 110 111 107 107
query43 547 505 502 502
query44 1212 818 769 769
query45 220 206 208 206
query46 1045 703 691 691
query47 1762 1620 1614 1614
query48 390 304 294 294
query49 1013 312 312 312
query50 798 317 369 317
query51 5368 5435 5298 5298
query52 110 100 95 95
query53 231 167 170 167
query54 1129 692 657 657
query55 107 96 99 96
query56 288 244 280 244
query57 1050 970 981 970
query58 293 282 266 266
query59 3017 2876 2788 2788
query60 343 298 296 296
query61 150 151 151 151
query62 588 478 513 478
query63 177 172 189 172
query64 5361 1792 1754 1754
query65 3398 3351 3318 3318
query66 1333 377 358 358
query67 15573 15457 14983 14983
query68 12998 566 549 549
query69 619 327 333 327
query70 1790 1582 1584 1582
query71 591 298 266 266
query72 5468 3454 3443 3443
query73 2609 335 344 335
query74 7056 6499 6493 6493
query75 5321 2278 2292 2278
query76 6420 1155 1226 1155
query77 792 329 302 302
query78 9072 8629 8534 8534
query79 1069 531 528 528
query80 553 356 336 336
query81 467 214 235 214
query82 224 107 108 107
query83 180 145 143 143
query84 258 57 57 57
query85 962 274 268 268
query86 575 449 433 433
query87 3737 3557 3572 3557
query88 3288 2590 2622 2590
query89 359 293 296 293
query90 2005 257 254 254
query91 129 91 96 91
query92 78 82 71 71
query93 1273 428 423 423
query94 960 286 250 250
query95 571 481 510 481
query96 638 345 343 343
query97 4427 4243 4206 4206
query98 261 217 208 208
query99 1131 883 852 852
Total cold run time: 289011 ms
Total hot run time: 183569 ms
```
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1882414400
<details>
<summary>TPC-H: <b>Total hot run time: 38676 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 2a3c6931763524a0be018c6b241a602e9e603abc, data reload: false
------ Round 1 ----------------------------------
q1 17721 4929 4984 4929
q2 2029 154 144 144
q3 10742 1143 1134 1134
q4 10534 779 794 779
q5 7774 2904 2934 2904
q6 206 121 121 121
q7 907 514 511 511
q8 9272 2001 2011 2001
q9 6497 6431 6400 6400
q10 8287 3044 3020 3020
q11 450 222 220 220
q12 390 230 228 228
q13 18018 3408 3374 3374
q14 232 217 206 206
q15 556 514 503 503
q16 478 396 382 382
q17 954 709 616 616
q18 7388 6738 6723 6723
q19 1567 1539 1512 1512
q20 698 322 300 300
q21 2774 2368 2366 2366
q22 355 303 330 303
Total cold run time: 107829 ms
Total hot run time: 38676 ms
----- Round 2, with runtime_filter_mode=off -----
q1 4941 5142 4907 4907
q2 348 238 241 238
q3 3296 3290 3280 3280
q4 2108 2024 2039 2024
q5 5795 5751 5759 5751
q6 224 119 117 117
q7 2333 1904 1882 1882
q8 3375 3467 3449 3449
q9 8775 8741 8738 8738
q10 3770 3836 3862 3836
q11 544 438 448 438
q12 806 631 624 624
q13 5342 3209 3196 3196
q14 304 247 286 247
q15 553 512 508 508
q16 546 486 489 486
q17 1877 1853 1840 1840
q18 8585 8468 8386 8386
q19 1592 1619 1621 1619
q20 2184 1958 1982 1958
q21 5602 5286 5251 5251
q22 511 441 456 441
Total cold run time: 63411 ms
Total hot run time: 59216 ms
```
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): suppory show constraint command [doris]
Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #29667:
URL: https://github.com/apache/doris/pull/29667#discussion_r1445585851
##########
regression-test/data/nereids_syntax_p0/constraint.out:
##########
@@ -0,0 +1,6 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !show_constrait --
+fk ForeignKeyConstraint (id) references regression_test_nereids_syntax_p0.t1 (id)
Review Comment:
it is better use full name, such as `FOREIGN KEY`
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowConstraintCommand.java:
##########
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands;
+
+import org.apache.doris.catalog.TableIf;
+import org.apache.doris.nereids.trees.plans.PlanType;
+import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
+import org.apache.doris.nereids.util.RelationUtil;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.StmtExecutor;
+
+import org.apache.hadoop.util.Lists;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * add constraint command
+ */
+public class ShowConstraintCommand extends Command implements NoForward {
Review Comment:
```suggestion
public class ShowConstraintsCommand extends Command implements NoForward {
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29667:
URL: https://github.com/apache/doris/pull/29667#issuecomment-1882420772
(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 47.83 seconds
stream load tsv: 568 seconds loaded 74807831229 Bytes, about 125 MB/s
stream load json: 19 seconds loaded 2358488459 Bytes, about 118 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 26.4 seconds inserted 10000000 Rows, about 378K ops/s
storage size: 17183589813 Bytes
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [feat](Nereids): support show constraint command [doris]
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on code in PR #29667:
URL: https://github.com/apache/doris/pull/29667#discussion_r1445606803
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowConstraintCommand.java:
##########
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands;
+
+import org.apache.doris.catalog.TableIf;
+import org.apache.doris.nereids.trees.plans.PlanType;
+import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
+import org.apache.doris.nereids.util.RelationUtil;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.StmtExecutor;
+
+import org.apache.hadoop.util.Lists;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * add constraint command
+ */
+public class ShowConstraintCommand extends Command implements NoForward {
+
+ public static final Logger LOG = LogManager.getLogger(ShowConstraintCommand.class);
+ private final List<String> nameParts;
+
+ /**
+ * constructor
+ */
+ public ShowConstraintCommand(List<String> nameParts) {
+ super(PlanType.SHOW_CONSTRAINT_COMMAND);
+ this.nameParts = nameParts;
+ }
+
+ @Override
+ public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
+ TableIf tableIf = RelationUtil.getDbAndTable(
+ RelationUtil.getQualifierName(ctx, nameParts), ctx.getEnv()).value();
+ List<List<String>> res = tableIf.getConstraintMap().entrySet().stream()
+ .map(e -> Lists.newArrayList(e.getKey(),
+ e.getValue().getClass().getSimpleName(),
Review Comment:
has fixed
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org