|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +suite("insert_overwrite_error_message_percent") { |
| 19 | + sql "drop table if exists insert_overwrite_error_message_percent_src" |
| 20 | + sql "drop table if exists insert_overwrite_error_message_percent_dst" |
| 21 | + |
| 22 | + sql """ |
| 23 | + create table insert_overwrite_error_message_percent_src ( |
| 24 | + id int, |
| 25 | + d varchar(10) |
| 26 | + ) engine=olap |
| 27 | + duplicate key(id) |
| 28 | + distributed by hash(id) buckets 1 |
| 29 | + properties ( |
| 30 | + 'replication_allocation' = 'tag.location.default: 1' |
| 31 | + ) |
| 32 | + """ |
| 33 | + |
| 34 | + sql """ |
| 35 | + create table insert_overwrite_error_message_percent_dst ( |
| 36 | + id int, |
| 37 | + ts bigint |
| 38 | + ) engine=olap |
| 39 | + duplicate key(id) |
| 40 | + distributed by hash(id) buckets 1 |
| 41 | + properties ( |
| 42 | + 'replication_allocation' = 'tag.location.default: 1' |
| 43 | + ) |
| 44 | + """ |
| 45 | + |
| 46 | + sql """ |
| 47 | + insert into insert_overwrite_error_message_percent_src values |
| 48 | + (1, '2024-01-01') |
| 49 | + """ |
| 50 | + |
| 51 | + test { |
| 52 | + sql """ |
| 53 | + insert overwrite table insert_overwrite_error_message_percent_dst |
| 54 | + select id, unix_timestamp(d, 'yyyyMMdd') |
| 55 | + from insert_overwrite_error_message_percent_src |
| 56 | + """ |
| 57 | + exception "Operation unix_timestamp of 2024-01-01, %Y%m%d is invalid" |
| 58 | + } |
| 59 | +} |
0 commit comments