Skip to content

Commit 6a328e8

Browse files
Update etlxlib.go
Add ETLX_DONT_RPLC_DT_PLCHLDR_NO_CBRCKTS to ignore date patterns that are not inside {}, like {YYYYMM}, but do not replace strings like "REFYYYYMM" in case your query has names that match those patterns.
1 parent 606781d commit 6a328e8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/etlx/etlxlib.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ func (etlx *ETLX) ReplaceQueryStringDate(query string, dateRef interface{}) stri
481481
}
482482
}
483483
// Handle cases for temporary tables with date extensions
484+
if os.Getenv("ETLX_DONT_RPLC_DT_PLCHLDR_NO_CBRCKTS") == "true" { // DO NOT REPLACE DATE PATT WITH NO CURLLY BRACKETS
485+
return query
486+
}
484487
patt = regexp.MustCompile(
485488
`YYYY.?MM.?DD|AAAA.?MM.?DD|YY.?MM.?DD|AA.?MM.?DD|YYYY.?MM|AAAA.?MM|YY.?MM|AA.?MM|MM.?DD|DD.?MM.?YYYY|DD.?MM.?AAAA|DD.?MM.?YY|DD.?MM.?AA`,
486489
)

0 commit comments

Comments
 (0)