Yingyi Bu | 391f09e | 2015-10-29 13:49:39 -0700 | [diff] [blame] | 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 | /* |
| 20 | * Description : This test case is to verify the fix for issue601 |
| 21 | * https://code.google.com/p/asterixdb/issues/detail?id=601 |
| 22 | * Expected Res : SUCCESS |
| 23 | * Date : 10th Oct 2014 |
| 24 | */ |
| 25 | |
| 26 | drop database tpch if exists; |
| 27 | create database tpch; |
| 28 | |
| 29 | use tpch; |
| 30 | |
| 31 | |
| 32 | create type tpch.LineItemType as |
| 33 | closed { |
| 34 | l_orderkey : int32, |
| 35 | l_partkey : int32, |
| 36 | l_suppkey : int32, |
| 37 | l_linenumber : int32, |
| 38 | l_quantity : double, |
| 39 | l_extendedprice : double, |
| 40 | l_discount : double, |
| 41 | l_tax : double, |
| 42 | l_returnflag : string, |
| 43 | l_linestatus : string, |
| 44 | l_shipdate : string, |
| 45 | l_commitdate : string, |
| 46 | l_receiptdate : string, |
| 47 | l_shipinstruct : string, |
| 48 | l_shipmode : string, |
| 49 | l_comment : string |
| 50 | } |
| 51 | |
| 52 | create table LineItem(LineItemType) primary key l_orderkey,l_linenumber; |
| 53 | |
| 54 | select element {'l_linenumber':l_linenumber,'count_order':tpch.count(l)} |
| 55 | from LineItem as l |
| 56 | group by l.l_linenumber as l_linenumber |
| 57 | ; |