| /* |
| * 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. |
| */ |
| // repeat_exec: %with% = ["", "WITH {'merge-policy': {'name': 'correlated-prefix','parameters': { 'max-mergable-component-size': 16384, 'max-tolerance-component-count': 3 }}}" ] |
| DROP DATAVERSE test IF EXISTS; |
| CREATE DATAVERSE test; |
| USE test; |
| |
| CREATE TYPE t1 AS { id: int, s_f1: string, s_f2: string?, i_f: int? }; |
| CREATE DATASET ds7(t1) PRIMARY KEY id %with%; |
| |
| CREATE INDEX idx1 ON ds7(s_f2); |
| CREATE INDEX idx2 ON ds7(s_f2: string) CAST (DEFAULT NULL); |
| CREATE INDEX idx3 ON ds7(s_f2: int) CAST (DEFAULT NULL); |
| |
| CREATE VIEW view7_1(id int, s_f2 string, i_f int) DEFAULT NULL AS SELECT id, s_f2, i_f FROM ds7; |
| CREATE VIEW view7_2(id int, s_f2 int, i_f int) DEFAULT NULL AS SELECT id, s_f2, i_f FROM ds7; |
| |
| USE test; |
| // index idx1 should be used |
| set `compiler.indexonly` "false"; // there is an issue with using index only plan where nulls/missings are included |
| SELECT id, s_f2 FROM ds7 WHERE s_f2 < "4" ORDER BY id; |