text: -- @@@ START COPYRIGHT @@@
  --
  -- 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.
  --
  -- @@@ END COPYRIGHT @@@
  
  drop table promotion_seq;
  drop table promotion_comp;
  
  -- Create a sequence file version of the promotion table.
  create table promotion_seq
  (
      p_promo_sk                int,
      p_promo_id                string,
      p_start_date_sk           int,
      p_end_date_sk             int,
      p_item_sk                 int,
      p_cost                    float,
      p_response_target         int,
      p_promo_name              string,
      p_channel_dmail           string,
      p_channel_email           string,
      p_channel_catalog         string,
      p_channel_tv              string,
      p_channel_radio           string,
      p_channel_press           string,
      p_channel_event           string,
      p_channel_demo            string,
      p_channel_details         string,
      p_purpose                 string,
      p_discount_active         string 
  )
  stored as sequencefile;
  
  -- Populate it.
  insert into table promotion_seq 
    select * from promotion 
    where p_promo_sk < 100;
  
  -- Setup for compression
  SET hive.exec.compress.output=true; 
  SET io.seqfile.compression.type=BLOCK;
  
  -- Create a compressed sequence file version of the promotion table.
  create table promotion_comp
  (
      p_promo_sk                int,
      p_promo_id                string,
      p_start_date_sk           int,
      p_end_date_sk             int,
      p_item_sk                 int,
      p_cost                    float,
      p_response_target         int,
      p_promo_name              string,
      p_channel_dmail           string,
      p_channel_email           string,
      p_channel_catalog         string,
      p_channel_tv              string,
      p_channel_radio           string,
      p_channel_press           string,
      p_channel_event           string,
      p_channel_demo            string,
      p_channel_details         string,
      p_purpose                 string,
      p_discount_active         string 
  )
  stored as sequencefile;
  
  -- Populate it.
  insert into table promotion_comp 
    select * from promotion
    where p_promo_sk < 100;
  