diff --git a/max2max/internal/loader/merge.go b/max2max/internal/loader/merge.go index f9ef4bb..f4a3e08 100644 --- a/max2max/internal/loader/merge.go +++ b/max2max/internal/loader/merge.go @@ -14,10 +14,10 @@ func NewMergeLoader(logger *slog.Logger) *mergeLoader { } } -func (l *mergeLoader) GetQuery(tableID, query string) string { - return "-- TODO merge loader" +func (l *mergeLoader) GetQuery(_, query string) string { + return query } -func (l *mergeLoader) GetPartitionedQuery(tableID, query string, partitionName []string) string { - return "-- TODO merge loader" +func (l *mergeLoader) GetPartitionedQuery(_, query string, _ []string) string { + return query } diff --git a/max2max/internal/loader/replace.go b/max2max/internal/loader/replace.go index e7e49b3..b2a1fe2 100644 --- a/max2max/internal/loader/replace.go +++ b/max2max/internal/loader/replace.go @@ -1,7 +1,9 @@ package loader import ( + "fmt" "log/slog" + "strings" ) type replaceLoader struct { @@ -15,9 +17,9 @@ func NewReplaceLoader(logger *slog.Logger) *replaceLoader { } 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) }