Browse Source

Add support for constraints

Nita Dembla 7 years ago
parent
commit
c122a5b79c
2 changed files with 6 additions and 0 deletions
  1. 2 0
      ddl-tpcds/bin_partitioned/add_constraints.sql
  2. 4 0
      tpcds-setup.sh

+ 2 - 0
ddl-tpcds/bin_partitioned/add_constraints.sql

@@ -155,3 +155,5 @@ alter table reason change column r_reason_id r_reason_id string constraint ${DB}
 alter table ship_mode change column sm_ship_mode_id sm_ship_mode_id string constraint ${DB}_smid_nn not null disable novalidate rely;
 alter table time_dim change column t_time_id t_time_id string constraint ${DB}_tid_nn not null disable novalidate rely;
 
+alter table customer change column c_customer_id c_customer_id string constraint ${DB}_cid_uq unique disable novalidate rely;
+

+ 4 - 0
tpcds-setup.sh

@@ -120,4 +120,8 @@ done
 
 make -j 1 -f $LOAD_FILE
 
+
+echo "Loading constraints"
+runcommand "$HIVE  ddl-tpcds/bin_partitioned/add_constraints.sql --hivevar DB=tpcds_bin_partitioned_${FORMAT}_${SCALE}"
+
 echo "Data loaded into database ${DATABASE}."