@@ -29,6 +29,8 @@ import (
29
29
"strings"
30
30
"time"
31
31
32
+ "golang.org/x/exp/slices"
33
+
32
34
"github.com/apache/incubator-devlake/core/dal"
33
35
"github.com/apache/incubator-devlake/core/errors"
34
36
"github.com/apache/incubator-devlake/core/plugin"
@@ -138,7 +140,6 @@ func createTmpTableInStarrocks(dc *DataConfigParams) (map[string]string, string,
138
140
table := dc .SrcTableName
139
141
starrocksTable := dc .DestTableName
140
142
starrocksTmpTable := fmt .Sprintf ("%s_tmp" , starrocksTable )
141
-
142
143
columnMetas , err := db .GetColumns (& Table {name : table }, nil )
143
144
updateColumn := config .UpdateColumn
144
145
columnMap := make (map [string ]string )
@@ -163,8 +164,21 @@ func createTmpTableInStarrocks(dc *DataConfigParams) (map[string]string, string,
163
164
} else {
164
165
return nil , "" , false , errors .NotFound .New (fmt .Sprintf ("unsupported dialect %s" , db .Dialect ()))
165
166
}
167
+ tableConfig , ok := config .TableConfigs [table ]
166
168
for _ , cm := range columnMetas {
167
169
name := cm .Name ()
170
+ if ok {
171
+ if len (tableConfig .ExcludedColumns ) > 0 {
172
+ if slices .Contains (tableConfig .ExcludedColumns , name ) {
173
+ continue
174
+ }
175
+ }
176
+ if len (tableConfig .IncludedColumns ) > 0 {
177
+ if ! slices .Contains (tableConfig .IncludedColumns , name ) {
178
+ continue
179
+ }
180
+ }
181
+ }
168
182
if name == updateColumn {
169
183
// check update column to detect skip or not
170
184
var updatedFrom time.Time
@@ -276,7 +290,6 @@ func copyDataToDst(dc *DataConfigParams, columnMap map[string]string, orderBy st
276
290
} else {
277
291
return err
278
292
}
279
-
280
293
}
281
294
defer rows .Close ()
282
295
0 commit comments