You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# finally generate first_day_sofa which depends on concepts in firstday folder
104
104
echo"">> postgres/postgres-make-concepts.sql
105
105
echo"-- final tables dependent on previous concepts">> postgres/postgres-make-concepts.sql
106
-
d=firstday
107
-
tbl=first_day_sofa
108
-
echo"-- THIS SCRIPT IS AUTOMATICALLY GENERATED. DO NOT EDIT IT DIRECTLY.">"postgres/${d}/${tbl}.sql"
109
-
echo"DROP TABLE IF EXISTS ${tbl}; CREATE TABLE ${tbl} AS ">>"postgres/${d}/${tbl}.sql"
110
-
cat "${d}/${tbl}.sql"| sed -r -e "${REGEX_ARRAY}"| sed -r -e "${REGEX_HOUR_INTERVAL}"| sed -r -e "${REGEX_INT}"| sed -r -e "${REGEX_DATETIME_DIFF}"| sed -r -e "${REGEX_SCHEMA}"| sed -r -e "${REGEX_INTERVAL}"| sed -r -e "${REGEX_SECONDS}"| perl -0777 -pe "${PERL_REGEX_ROUND}">>"postgres/${d}/${tbl}.sql"
# make the sub-folder for postgres if it does not exist
113
+
mkdir -p "postgres/${d}"
114
+
115
+
# convert the bigquery script to psql and output it to the appropriate subfolder
116
+
echo -n "${d}.${tbl} .."
117
+
echo"-- THIS SCRIPT IS AUTOMATICALLY GENERATED. DO NOT EDIT IT DIRECTLY.">"postgres/${d}/${tbl}.sql"
118
+
echo"DROP TABLE IF EXISTS ${tbl}; CREATE TABLE ${tbl} AS ">>"postgres/${d}/${tbl}.sql"
119
+
120
+
cat "${d}/${tbl}.sql"| sed -r -e "${REGEX_ARRAY}"| sed -r -e "${REGEX_HOUR_INTERVAL}"| sed -r -e "${REGEX_INT}"| sed -r -e "${REGEX_DATETIME_DIFF}"| sed -r -e "${REGEX_SCHEMA}"| sed -r -e "${REGEX_INTERVAL}"| sed -r -e "${REGEX_SECONDS}">>"postgres/${d}/${tbl}.sql"
121
+
122
+
# write out a call to this script in the make concepts file
0 commit comments