@@ -17,17 +17,15 @@ INPUT_PATH_ONTIME="${SCENARIO_DIR}/${INPUT_FILE_ONTIME}"
1717echo " OK Inserted data with partitioning into table ${TABLE_NAME_IRIS} "
1818
1919# List partitions and validate output
20- LIST_PARTITIONS_OUT_IRIS=$( mktemp)
21- trap " rm -f '${LIST_PARTITIONS_OUT_IRIS} '" EXIT
22- {{ICE_CLI}} --config {{CLI_CONFIG}} list-partitions ${TABLE_NAME_IRIS} > " ${LIST_PARTITIONS_OUT_IRIS} "
23- if ! grep -q " partitions:" " ${LIST_PARTITIONS_OUT_IRIS} " ; then
20+ LIST_PARTITIONS_OUT_IRIS=$( {{ICE_CLI}} --config {{CLI_CONFIG}} list-partitions " ${TABLE_NAME_IRIS} " )
21+ if ! grep -q " partitions:" <<< " ${LIST_PARTITIONS_OUT_IRIS}" ; then
2422 echo " FAIL: list-partitions output missing 'partitions:' section"
25- cat " ${LIST_PARTITIONS_OUT_IRIS} "
23+ printf ' %s\n ' " ${LIST_PARTITIONS_OUT_IRIS} "
2624 exit 1
2725fi
28- if ! grep -qE -- " - *[^=]+=" " ${LIST_PARTITIONS_OUT_IRIS} " ; then
26+ if ! grep -qE -- " - *[^=]+=" <<< " ${LIST_PARTITIONS_OUT_IRIS}" ; then
2927 echo " FAIL: list-partitions output has no partition entries (expected at least one key=value)"
30- cat " ${LIST_PARTITIONS_OUT_IRIS} "
28+ printf ' %s\n ' " ${LIST_PARTITIONS_OUT_IRIS} "
3129 exit 1
3230fi
3331echo " OK Listed and validated partitions for ${TABLE_NAME_IRIS} "
@@ -37,17 +35,15 @@ echo "OK Listed and validated partitions for ${TABLE_NAME_IRIS}"
3735echo " OK Inserted data with partitioning into table ${TABLE_NAME_ONTIME} "
3836
3937# List partitions and validate output
40- LIST_PARTITIONS_OUT_ONTIME=$( mktemp)
41- trap " rm -f '${LIST_PARTITIONS_OUT_ONTIME} '" EXIT
42- {{ICE_CLI}} --config {{CLI_CONFIG}} list-partitions ${TABLE_NAME_ONTIME} > " ${LIST_PARTITIONS_OUT_ONTIME} "
43- if ! grep -q " partitions:" " ${LIST_PARTITIONS_OUT_ONTIME} " ; then
38+ LIST_PARTITIONS_OUT_ONTIME=$( {{ICE_CLI}} --config {{CLI_CONFIG}} list-partitions " ${TABLE_NAME_ONTIME} " )
39+ if ! grep -q " partitions:" <<< " ${LIST_PARTITIONS_OUT_ONTIME}" ; then
4440 echo " FAIL: list-partitions output missing 'partitions:' section"
45- cat " ${LIST_PARTITIONS_OUT_ONTIME} "
41+ printf ' %s\n ' " ${LIST_PARTITIONS_OUT_ONTIME} "
4642 exit 1
4743fi
48- if ! grep -qE -- " - *[^=]+=" " ${LIST_PARTITIONS_OUT_ONTIME} " ; then
44+ if ! grep -qE -- " - *[^=]+=" <<< " ${LIST_PARTITIONS_OUT_ONTIME}" ; then
4945 echo " FAIL: list-partitions output has no partition entries (expected at least one key=value)"
50- cat " ${LIST_PARTITIONS_OUT_ONTIME} "
46+ printf ' %s\n ' " ${LIST_PARTITIONS_OUT_ONTIME} "
5147 exit 1
5248fi
5349echo " OK Listed and validated partitions for ${TABLE_NAME_ONTIME} "
@@ -62,11 +58,40 @@ if [[ "${FILES_OUT_ONTIME}" != *${EXPECTED_DATA_PATH_ONTIME}* ]]; then
6258fi
6359echo " OK Validated correct partitioned data file path for ${TABLE_NAME_ONTIME} "
6460
61+ # Create table with bucket partition and insert data
62+ {{ICE_CLI}} --config {{CLI_CONFIG}} insert --create-table ${TABLE_NAME_BUCKET} ${INPUT_PATH_IRIS} --partition=" ${PARTITION_SPEC_BUCKET} "
63+ echo " OK Inserted data with bucket partitioning into table ${TABLE_NAME_BUCKET} "
64+
65+ # List partitions and validate output
66+ LIST_PARTITIONS_OUT_BUCKET=$( {{ICE_CLI}} --config {{CLI_CONFIG}} list-partitions " ${TABLE_NAME_BUCKET} " )
67+ if ! grep -q " partitions:" <<< " ${LIST_PARTITIONS_OUT_BUCKET}" ; then
68+ echo " FAIL: list-partitions output missing 'partitions:' section"
69+ printf ' %s\n' " ${LIST_PARTITIONS_OUT_BUCKET} "
70+ exit 1
71+ fi
72+ if ! grep -q " variety_bucket=" <<< " ${LIST_PARTITIONS_OUT_BUCKET}" ; then
73+ echo " FAIL: list-partitions output missing bucket partition entries (expected 'variety_bucket=')"
74+ printf ' %s\n' " ${LIST_PARTITIONS_OUT_BUCKET} "
75+ exit 1
76+ fi
77+ echo " OK Listed and validated bucket partitions for ${TABLE_NAME_BUCKET} "
78+
79+ # Validate data file was inserted to correct bucket-partitioned path
80+ FILES_OUT_BUCKET=$( {{ICE_CLI}} --config {{CLI_CONFIG}} files ${TABLE_NAME_BUCKET} )
81+
82+ if [[ " ${FILES_OUT_BUCKET} " != * ${EXPECTED_DATA_PATH_BUCKET} * ]]; then
83+ echo " FAIL: expected substring '${EXPECTED_DATA_PATH_BUCKET} ' not found in files command output: ${FILES_OUT_BUCKET} "
84+ exit 1
85+ fi
86+ echo " OK Validated correct bucket-partitioned data file path for ${TABLE_NAME_BUCKET} "
87+
6588# Cleanup
6689{{ICE_CLI}} --config {{CLI_CONFIG}} delete-table ${TABLE_NAME_IRIS}
6790echo " OK Deleted table: ${TABLE_NAME_IRIS} "
6891{{ICE_CLI}} --config {{CLI_CONFIG}} delete-table ${TABLE_NAME_ONTIME}
6992echo " OK Deleted table: ${TABLE_NAME_ONTIME} "
93+ {{ICE_CLI}} --config {{CLI_CONFIG}} delete-table ${TABLE_NAME_BUCKET}
94+ echo " OK Deleted table: ${TABLE_NAME_BUCKET} "
7095
7196{{ICE_CLI}} --config {{CLI_CONFIG}} delete-namespace ${NAMESPACE_NAME}
7297echo " OK Deleted namespace: ${NAMESPACE_NAME} "
0 commit comments