#! /bin/sh # Script to generate test cases for IGNORE NULLS option of some window # functions (lead, lag, first_value, last_value, and nth_value) in the # regression test SQL (window.sql). This script supposed to read # window.sql from stdin and inserts "ignore null" before "over" on all # occurrences of the window functions that accept IGNORE NULLS, then # print it to stdout. Since currently the data set used for the # existing regression test (window.sql) does not include NULLs, the # test result using the results of this script is expected be # identical to the existing results of existing window.sql (of course # except the SQL statements). sed -r \ -e "s/lead\(([^)]*)\) over/lead(\1) ignore nulls over/g" \ -e "s/lag\(([^)]*)\) over/lag(\1) ignore nulls over/g" \ -e "s/first_value\(([^)]*)\) over/first_value(\1) ignore nulls over/g" \ -e "s/last_value\(([^)]*)\) over/last_value(\1) ignore nulls over/g" \ -e "s/nth_value\(([^)]*)\) over/nth_value(\1) ignore nulls over/g"