@@ -969,18 +969,21 @@ func (conn *BaseConn) setTransforms(columns iop.Columns) {
969969 // add new
970970 for _ , col := range columns {
971971 key := strings .ToLower (col .Name )
972- if g .In (conn .Type , dbio .TypeDbAzure , dbio .TypeDbSQLServer , dbio .TypeDbAzureDWH ) {
972+ vals := colTransforms [key ]
973+ switch conn .Type {
974+ case dbio .TypeDbAzure , dbio .TypeDbSQLServer , dbio .TypeDbAzureDWH :
973975 if strings .ToLower (col .DbType ) == "uniqueidentifier" {
974-
975- if vals , ok := colTransforms [key ]; ok {
976- // only add transform parse_ms_uuid if parse_uuid is not specified
977- if ! lo .Contains (vals , "parse_uuid" ) {
978- g .Debug (`setting transform "parse_ms_uuid" for column "%s"` , col .Name )
979- colTransforms [key ] = append ([]string {"parse_ms_uuid" }, vals ... )
980- }
981- } else {
982- g .Debug (`setting transform "parse_ms_uuid" for column %s` , col .Name )
983- colTransforms [key ] = []string {"parse_ms_uuid" }
976+ if ! lo .Contains (vals , "parse_uuid" ) {
977+ g .Debug (`setting transform "parse_ms_uuid" for column "%s"` , col .Name )
978+ colTransforms [key ] = append ([]string {"parse_ms_uuid" }, vals ... )
979+ }
980+ }
981+ case dbio .TypeDbMySQL , dbio .TypeDbMariaDB , dbio .TypeDbStarRocks :
982+ if strings .ToLower (col .DbType ) == "bit" {
983+ // only add transform parse_bit if binary_to_hex or binary_to_decimal is not specified
984+ if ! lo .Contains (vals , "binary_to_hex" ) && ! lo .Contains (vals , "binary_to_decimal" ) {
985+ g .Debug (`setting transform "parse_bit" for column "%s"` , col .Name )
986+ colTransforms [key ] = append ([]string {"parse_bit" }, vals ... )
984987 }
985988 }
986989 }
0 commit comments