|
| 1 | +-- |
| 2 | +-- Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +-- or more contributor license agreements. See the NOTICE file |
| 4 | +-- distributed with this work for additional information |
| 5 | +-- regarding copyright ownership. The ASF licenses this file |
| 6 | +-- to you under the Apache License, Version 2.0 (the |
| 7 | +-- "License"); you may not use this file except in compliance |
| 8 | +-- with the License. You may obtain a copy of the License at |
| 9 | +-- |
| 10 | +-- http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +-- |
| 12 | +-- Unless required by applicable law or agreed to in writing, |
| 13 | +-- software distributed under the License is distributed on an |
| 14 | +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +-- KIND, either express or implied. See the License for the |
| 16 | +-- specific language governing permissions and limitations |
| 17 | +-- under the License. |
| 18 | +-- |
| 19 | +DROP TABLE IF EXISTS `insert_into_select_table1`; |
| 20 | + |
| 21 | +affected_rows: 0 |
| 22 | + |
| 23 | +CREATE TABLE `insert_into_select_table1` ( |
| 24 | + `timestamp` timestamp NOT NULL, |
| 25 | + `value` int, |
| 26 | + `name` string, |
| 27 | + timestamp KEY (timestamp)) ENGINE=Analytic |
| 28 | +WITH( |
| 29 | + enable_ttl='false' |
| 30 | +); |
| 31 | + |
| 32 | +affected_rows: 0 |
| 33 | + |
| 34 | +INSERT INTO `insert_into_select_table1` (`timestamp`, `value`, `name`) |
| 35 | +VALUES |
| 36 | + (1, 100, "s1"), |
| 37 | + (2, 200, "s2"), |
| 38 | + (3, 300, "s3"); |
| 39 | + |
| 40 | +affected_rows: 3 |
| 41 | + |
| 42 | +DROP TABLE IF EXISTS `insert_into_select_table2`; |
| 43 | + |
| 44 | +affected_rows: 0 |
| 45 | + |
| 46 | +CREATE TABLE `insert_into_select_table2` ( |
| 47 | + `timestamp` timestamp NOT NULL, |
| 48 | + `value` int, |
| 49 | + `name` string NULL, |
| 50 | + timestamp KEY (timestamp)) ENGINE=Analytic |
| 51 | +WITH( |
| 52 | + enable_ttl='false' |
| 53 | +); |
| 54 | + |
| 55 | +affected_rows: 0 |
| 56 | + |
| 57 | +INSERT INTO `insert_into_select_table2` (`timestamp`, `value`) |
| 58 | +SELECT `timestamp`, `value` |
| 59 | +FROM `insert_into_select_table1`; |
| 60 | + |
| 61 | +affected_rows: 3 |
| 62 | + |
| 63 | +SELECT `timestamp`, `value`, `name` |
| 64 | +FROM `insert_into_select_table2`; |
| 65 | + |
| 66 | +timestamp,value,name, |
| 67 | +Timestamp(1),Int32(100),String(""), |
| 68 | +Timestamp(2),Int32(200),String(""), |
| 69 | +Timestamp(3),Int32(300),String(""), |
| 70 | + |
| 71 | + |
| 72 | +DROP TABLE `insert_into_select_table1`; |
| 73 | + |
| 74 | +affected_rows: 0 |
| 75 | + |
| 76 | +DROP TABLE `insert_into_select_table2`; |
| 77 | + |
| 78 | +affected_rows: 0 |
| 79 | + |
0 commit comments