Skip to content

Commit

Permalink
feat: starrocsk plugin add table config (#8287)
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice authored Feb 5, 2025
1 parent 6e14cfa commit 0ec948b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/plugins/starrocks/tasks/task_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package tasks
type TableConfig struct {
IncludedColumns []string `mapstructure:"included_columns"`
ExcludedColumns []string `mapstructure:"excluded_columns"`
Where string `mapstructure:"where"`
}

type StarRocksConfig struct {
Expand Down
8 changes: 7 additions & 1 deletion backend/plugins/starrocks/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,26 @@ func copyDataToDst(dc *DataConfigParams, columnMap map[string]string, orderBy st
table := dc.SrcTableName
starrocksTable := dc.DestTableName
starrocksTmpTable := fmt.Sprintf("%s_tmp", starrocksTable)

tableConfig, ok := config.TableConfigs[table]
where := ""
if ok {
where = tableConfig.Where
}
var offset int
var err error
var rows dal.Rows
rows, err = db.Cursor(
dal.From(table),
dal.Orderby(orderBy),
dal.Where(where),
)
if err != nil {
if strings.Contains(err.Error(), "cached plan must not change result type") {
logger.Warn(err, "skip err: cached plan must not change result type")
rows, err = db.Cursor(
dal.From(table),
dal.Orderby(orderBy),
dal.Where(where),
)
if err != nil {
return err
Expand Down

0 comments on commit 0ec948b

Please sign in to comment.