Yingyi Bu | 947fc3c | 2016-01-27 20:14:47 -0800 | [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 ASTERIXDB-1005 |
| 21 | * https://issues.apache.org/jira/browse/ASTERIXDB-1005 |
| 22 | * Expected Result : Success |
| 23 | * Date : 10th January 2016 |
| 24 | */ |
| 25 | |
| 26 | drop dataverse deliber if exists; |
| 27 | create dataverse deliber; |
| 28 | use dataverse deliber; |
| 29 | |
| 30 | // Dish served by a restaurant |
| 31 | create type DishesType as open |
| 32 | { name: string, price: double } |
| 33 | |
| 34 | // Bank account type |
| 35 | create type BankAccountType as open{ |
| 36 | bank_account_number: string, |
| 37 | bank_account_routing_number: string |
| 38 | } |
| 39 | |
| 40 | // Restaurant's information |
| 41 | create type RestaurantsType as open { |
| 42 | restr_id: int64, |
| 43 | name: string, |
| 44 | address: string, |
| 45 | bank_account: BankAccountType, |
| 46 | last_bank_transaction_datetime: datetime, |
| 47 | cuisine: {{ string }}, |
| 48 | dish: {{ DishesType }} |
| 49 | } |
| 50 | |
| 51 | // Creating datasets for Users, Restaurants, and Orders |
| 52 | create dataset Restaurants(RestaurantsType) |
| 53 | primary key restr_id; |
| 54 | |
| 55 | for $r in dataset Restaurants |
| 56 | where some $c in $r.cuisine satisfies $c = "Mexican" or $c = "Italian" |
| 57 | order by $r.name |
| 58 | return |
| 59 | {"name":$r.name, "cuisines":$r.cuisine} |