blob: 28e60df85ff53f1d3cc753aeef8c4f1b84a45d61 [file] [log] [blame]
/*
* 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.
*/
/*
* Description : This test case is to verify the fix for issue 1806. p_sort enabled.
* https://issues.apache.org/jira/browse/ASTERIXDB-1806
* Expected Res : Non-index utilization Plan
*/
drop dataverse tpch if exists;
create dataverse tpch;
use tpch;
create type LineItemType as closed {
l_orderkey : integer,
l_partkey : integer,
l_suppkey : integer,
l_linenumber : integer,
l_quantity : double,
l_extendedprice : double,
l_discount : double,
l_tax : double,
l_returnflag : string,
l_linestatus : string,
l_shipdate : string,
l_commitdate : string,
l_receiptdate : string,
l_shipinstruct : string,
l_shipmode : string,
l_comment : string
};
create dataset LineItem(LineItemType) primary key l_orderkey,l_linenumber;
SET `import-private-functions` "true";
SET `compiler.sort.parallel` "true";
SELECT l_returnflag,
l_linestatus,
sum(l_quantity) AS sum_qty,
sum(l_extendedprice) AS sum_base_price,
sum(l_extendedprice * (1 - l_discount)) AS sum_disc_price,
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge,
avg(l_quantity) AS ave_qty,
avg(l_extendedprice) AS ave_price,
avg(l_discount) AS ave_disc,
count(1) AS count_order
FROM LineItem l
WHERE inject_failure(l.l_shipdate <= '1998-09-02', l.l_orderkey=5988)
GROUP BY l_returnflag, l_linestatus
ORDER BY l_returnflag, l_linestatus;