/*
 * 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.
 */

drop  dataverse fuzzyjoin if exists;
create  dataverse fuzzyjoin;

use fuzzyjoin;


create type fuzzyjoin.AddressType as
 closed {
  street : string,
  city : string,
  zip : string,
  latlong : point
}

create type fuzzyjoin.UserType as
{
  name : string,
  interests : {{string}},
  address : AddressType,
  member_of : {{{
          sig_id : int64,
          chapter_name : string,
          member_since : date
      }
}}
}

create  dataset User(UserType) primary key name;

