-- 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.
set datanucleus.cache.collections=false;

set hive.stats.dbclass=hbase;

create table stats_src like src;
insert overwrite table stats_src select * from src;
analyze table stats_src compute statistics;
desc formatted stats_src;

create table hbase_part like srcpart;

insert overwrite table hbase_part partition (ds='2010-04-08', hr = '11') select key, value from src;
insert overwrite table hbase_part partition (ds='2010-04-08', hr = '12') select key, value from src;

analyze table hbase_part partition(ds='2008-04-08', hr=11) compute statistics;
analyze table hbase_part partition(ds='2008-04-08', hr=12) compute statistics;

desc formatted hbase_part;
desc formatted hbase_part partition (ds='2010-04-08', hr = '11');
desc formatted hbase_part partition (ds='2010-04-08', hr = '12');

