@@ -270,6 +270,10 @@ func PrintRegularTableCreateStatement(metadataFile *utils.FileWithByteCount, toc
270270 }
271271
272272 if table .StorageOpts != "" {
273+ if strings .Contains (table .StorageOpts , "appendonly=true" ) {
274+ table .StorageOpts = removeFillFactor (table .StorageOpts )
275+ }
276+
273277 if destDBVersion .IsHDW () && destDBVersion .Is ("3" ) {
274278 metadataFile .MustPrintf ("WITH (%s) " , rewriteAppendonly (rewriteCompressAlgorithm (replaceBlocksize (table .StorageOpts ))))
275279 } else {
@@ -305,6 +309,18 @@ func PrintRegularTableCreateStatement(metadataFile *utils.FileWithByteCount, toc
305309 }
306310}
307311
312+ func removeFillFactor (storageOpts string ) string {
313+ opts := strings .Split (storageOpts , "," )
314+ newOpts := make ([]string , 0 , len (opts ))
315+ for _ , opt := range opts {
316+ trimmedOpt := strings .TrimSpace (opt )
317+ if ! strings .HasPrefix (trimmedOpt , "fillfactor=" ) {
318+ newOpts = append (newOpts , trimmedOpt )
319+ }
320+ }
321+ return strings .Join (newOpts , ", " )
322+ }
323+
308324func replaceTableSpace (content string ) string {
309325 results := ""
310326 format := regexp .MustCompile (`(.+)TABLESPACE ([^,]+)(,| |$)` )
0 commit comments