Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Apr 22, 2024
1 parent 7af048b commit c551a08
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions clients/snowflake/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ import (
// This is necessary for `PUT` commands. The fq name looks like <namespace>.<tableName>
// Namespace may contain both database and schema.
func addPrefixToTableName(tableID types.TableIdentifier, prefix string) string {
fqTableName := tableID.FullyQualifiedName()
tableParts := strings.Split(fqTableName, ".")
if len(tableParts) == 1 {
return prefix + fqTableName
}

return fmt.Sprintf("%s.%s%s",
strings.Join(tableParts[0:len(tableParts)-1], "."), prefix, tableParts[len(tableParts)-1])
return tableID.WithTable(prefix + tableID.Table()).FullyQualifiedName()
}

// escapeColumns will take columns, filter out invalid, escape and return them in ordered received.
Expand Down

0 comments on commit c551a08

Please sign in to comment.