-- Phoenix Bulk Loaded 
CREATE TABLE IF NOT EXISTS test
(
  file_name VARCHAR NOT NULL,
  rec_num INTEGER NOT NULL,
  m.epoch_time BIGINT,
  m.timet VARCHAR,
  m.site VARCHAR,
  m.proto INTEGER,
  m.saddr VARCHAR,
  m.daddr VARCHAR,
  m.sport INTEGER,
  m.dport INTEGER,
  m.mf INTEGER,
  m.cf INTEGER,
  m.dur DOUBLE,
  m.sdata BIGINT,
  m.ddata BIGINT,
  m.sbyte BIGINT,
  m.dbyte BIGINT,
  m.spkt INTEGER,
  m.dpkt  INTEGER,
  m.siopt INTEGER,
  m.diopt INTEGER,
  m.stopt INTEGER,
  m.dtopt INTEGER,
  m.sflags VARCHAR,
  m.dflags VARCHAR,
  m.flags VARCHAR,
  m.sfseq BIGINT,
  m.dfseq BIGINT,
  m.slseq BIGINT,
  m.dlseq BIGINT,
  m.category VARCHAR,
  m.field1 VARCHAR,
  m.field2 VARCHAR,
  m.field3 DOUBLE,
  m.field4 DOUBLE,
  m.field5 VARCHAR,
  m.field6 VARCHAR,
  m.field7 DOUBLE,
  m.field8 DOUBLE,
  m.field9 DOUBLE
 CONSTRAINT pkey PRIMARY KEY (file_name,rec_num)
) IMMUTABLE_ROWS=true,COMPRESSION='SNAPPY',SALT_BUCKETS=40,SPLIT_POLICY='org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy';

--  indexes
CREATE INDEX IF NOT EXISTS test_category_idx  ON test(m.category) COMPRESSION='SNAPPY',MAX_FILESIZE='1000000000',SPLIT_POLICY='org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy';
CREATE INDEX IF NOT EXISTS test_saddr_idx  ON test(m.saddr,m.daddr) COMPRESSION='SNAPPY',MAX_FILESIZE='1000000000',SPLIT_POLICY='org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy';
CREATE INDEX IF NOT EXISTS test_field1_idx  ON test(m.field1,m.field2) COMPRESSION='SNAPPY',MAX_FILESIZE='1000000000',SPLIT_POLICY='org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy';
CREATE INDEX IF NOT EXISTS test_field5_idx  ON test(m.field5,m.field6) COMPRESSION='SNAPPY',MAX_FILESIZE='1000000000',SPLIT_POLICY='org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy';
