diff --git a/max2max/internal/loader/replace.go b/max2max/internal/loader/replace.go index e7e49b3..f7bb479 100644 --- a/max2max/internal/loader/replace.go +++ b/max2max/internal/loader/replace.go @@ -1,23 +1,25 @@ package loader import ( + "fmt" "log/slog" + "strings" ) type replaceLoader struct { logger *slog.Logger } -func NewReplaceLoader(logger *slog.Logger) *replaceLoader { +func NewReplaceLoader(logger *slog.Logger) (*replaceLoader, error) { return &replaceLoader{ logger: logger, - } + }, nil } func (l *replaceLoader) GetQuery(tableID, query string) string { - return "-- TODO replace loader" + return fmt.Sprintf("INSERT OVERWRITE TABLE %s %s", tableID, query) } -func (l *replaceLoader) GetPartitionedQuery(tableID, query string, partitionName []string) string { - return "-- TODO replace loader" +func (l *replaceLoader) GetPartitionedQuery(tableID, query string, partitionNames []string) string { + return fmt.Sprintf("INSERT OVERWRITE TABLE %s PARTITION (%s) %s", tableID, strings.Join(partitionNames, ", "), query) }