long2ice commented on code in PR #2422:
URL: https://github.com/apache/incubator-devlake/pull/2422#discussion_r915605610


##########
plugins/starrocks/tasks.go:
##########
@@ -76,33 +84,47 @@ func LoadData(c core.SubTaskContext) error {
        return nil
 }
 func createTable(starrocks *sql.DB, db dal.Dal, starrocksTable string, table 
string, c core.SubTaskContext, extra string) error {
-       columnMap, err := db.GetTableColumns(table)
+
+       columeMetas, err := db.GetColumns(&Table{name: table}, nil)
        if err != nil {
                return err
        }
-       var pk string
-       if _, ok := columnMap["id"]; ok {
-               pk = "id"
-       } else {
-               for k := range columnMap {
-                       pk = k
-                       break
-               }
-       }
+       var pks string
        var columns []string
-       for field, dataType := range columnMap {
-               starrocksDatatype := getDataType(dataType)
-               column := fmt.Sprintf("%s %s", field, starrocksDatatype)
+       firstcm := ""
+       for _, cm := range columeMetas {
+               name := cm.Name()
+               starrocksDatatype, ok := cm.ColumnType()

Review Comment:
   这里是直接把MySQL的数据类型传递到starrocks的建表语句了?两个的类型不完全一样,需要做映射



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to