Skip to content

Commit

Permalink
[ddl] Drop Temp Table fix. (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored Jun 17, 2024
1 parent deb0ce0 commit 7f46499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/destination/ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// It has a safety check to make sure the tableName contains the `constants.ArtiePrefix` key.
// Temporary tables look like this: database.schema.tableName__artie__RANDOM_STRING(5)_expiryUnixTs
func DropTemporaryTable(dwh destination.DataWarehouse, tableIdentifier sql.TableIdentifier, shouldReturnError bool) error {
if strings.Contains(tableIdentifier.Table(), constants.ArtiePrefix) {
if strings.Contains(strings.ToLower(tableIdentifier.Table()), constants.ArtiePrefix) {
sqlCommand := fmt.Sprintf("DROP TABLE IF EXISTS %s", tableIdentifier.FullyQualifiedName())
if _, err := dwh.Exec(sqlCommand); err != nil {
slog.Warn("Failed to drop temporary table, it will get garbage collected by the TTL...",
Expand Down

0 comments on commit 7f46499

Please sign in to comment.