blob: 98cd634654b37bbea30978ed4a92091adbc06c4e [file] [log] [blame]
Yingyi Bu947fc3c2016-01-27 20:14:47 -08001/*
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
26drop dataverse deliber if exists;
27create dataverse deliber;
28use dataverse deliber;
29
30// Dish served by a restaurant
31create type DishesType as open
32{ name: string, price: double }
33
34// Bank account type
35create type BankAccountType as open{
36 bank_account_number: string,
37 bank_account_routing_number: string
38}
39
40// Restaurant's information
41create type RestaurantsType as open {
42restr_id: int64,
43name: string,
44address: string,
45bank_account: BankAccountType,
46last_bank_transaction_datetime: datetime,
47cuisine: {{ string }},
48dish: {{ DishesType }}
49}
50
51// Creating datasets for Users, Restaurants, and Orders
52create dataset Restaurants(RestaurantsType)
53primary key restr_id;
54
55for $r in dataset Restaurants
56where some $c in $r.cuisine satisfies $c = "Mexican" or $c = "Italian"
57order by $r.name
58return
59{"name":$r.name, "cuisines":$r.cuisine}