|
| 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("test_query_json_object", "query") { |
| 19 | + sql "set enable_vectorized_engine = false;" |
| 20 | + def tableName = "test_query_json_object" |
| 21 | + sql "DROP TABLE IF EXISTS ${tableName}" |
| 22 | + sql """ |
| 23 | + CREATE TABLE `${tableName}` ( |
| 24 | + `k1` int(11) NULL COMMENT "user id" |
| 25 | + ) ENGINE=OLAP |
| 26 | + DUPLICATE KEY(`k1`) |
| 27 | + COMMENT "OLAP" |
| 28 | + DISTRIBUTED BY HASH(`k1`) BUCKETS 1 |
| 29 | + PROPERTIES ( |
| 30 | + "replication_allocation" = "tag.location.default: 1", |
| 31 | + "in_memory" = "false", |
| 32 | + "storage_format" = "V2" |
| 33 | + ); |
| 34 | + """ |
| 35 | + sql "insert into ${tableName} values(null);" |
| 36 | + sql "insert into ${tableName} values(null);" |
| 37 | + sql "insert into ${tableName} values(null);" |
| 38 | + sql "insert into ${tableName} values(null);" |
| 39 | + sql "insert into ${tableName} values(null);" |
| 40 | + sql "insert into ${tableName} values(1);" |
| 41 | + qt_sql "select json_object(\"k1\",k1) from ${tableName};" |
| 42 | + sql "DROP TABLE ${tableName};" |
| 43 | +} |
0 commit comments