@@ -291,6 +291,38 @@ public void testModifyColumnTypeWithDefault()
291291 Assert .assertEquals (newColumnType , columnType .toLowerCase ());
292292 }
293293
294+ @ Test
295+ public void testModifyColumnTypeWithDefault2 ()
296+ throws IOException , IllegalArgumentException , InterruptedException {
297+ String modifyColumnTbls = "modify_column_type_with_default_value2" ;
298+ ContainerUtils .executeSQLStatement (
299+ getDorisQueryConnection (),
300+ LOG ,
301+ String .format ("CREATE DATABASE IF NOT EXISTS %s" , DATABASE ),
302+ String .format ("DROP TABLE IF EXISTS %s.%s" , DATABASE , modifyColumnTbls ),
303+ String .format (
304+ "CREATE TABLE %s.%s ( \n "
305+ + "`id` int not null,\n "
306+ + "`cname` varchar(10) NOT NULL DEFAULT ''\n "
307+ + ")"
308+ + "UNIQUE KEY(`id`)\n "
309+ + "DISTRIBUTED BY HASH(`id`) BUCKETS 1\n "
310+ + "PROPERTIES (\n "
311+ + "\" replication_num\" = \" 1\" \n "
312+ + ")\n " ,
313+ DATABASE ,
314+ modifyColumnTbls ));
315+
316+ String columnName = "cname" ;
317+ String newColumnType = "varchar(11)" ;
318+ FieldSchema field = new FieldSchema (columnName , newColumnType , "" );
319+ schemaChangeManager .modifyColumnDataType (DATABASE , modifyColumnTbls , field );
320+
321+ Thread .sleep (3_000 );
322+ String columnType = getColumnType (modifyColumnTbls , columnName );
323+ Assert .assertEquals ("varchar" , columnType .toLowerCase ());
324+ }
325+
294326 @ Test
295327 public void testModifyColumnTypeWithDefaultAndChange ()
296328 throws IOException , IllegalArgumentException , InterruptedException {
0 commit comments