From 2294238cea314406bc15a6b06e56bcaf783fe5c1 Mon Sep 17 00:00:00 2001 From: yun Date: Thu, 24 Oct 2024 03:07:47 -0700 Subject: [PATCH] fix silly bug: correctly remove wrapper --- core/dbio/database/database_proton.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/dbio/database/database_proton.go b/core/dbio/database/database_proton.go index 3eb9bfb3..6228dcc6 100755 --- a/core/dbio/database/database_proton.go +++ b/core/dbio/database/database_proton.go @@ -328,10 +328,14 @@ func (conn *ProtonConn) processBatch(tableFName string, table Table, batch *iop. for i, col := range batch.Columns { dbType := strings.ToLower(col.DbType) - dbType = strings.TrimPrefix(dbType, "low_cardinality(") - dbType = strings.TrimPrefix(dbType, "nullable(") - - dbType = strings.TrimSuffix(dbType, ")") + if strings.HasPrefix(dbType, "nullable(") { + dbType = strings.TrimPrefix(dbType, "nullable(") + dbType = strings.TrimSuffix(dbType, ")") + } + if strings.HasPrefix(dbType, "low_cardinality(") { + dbType = strings.TrimPrefix(dbType, "low_cardinality(") + dbType = strings.TrimSuffix(dbType, ")") + } switch dbType { case "int8":