@@ -291,6 +291,37 @@ 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 , modifyColumnTbls ));
314+
315+ String columnName = "cname" ;
316+ String newColumnType = "varchar(11)" ;
317+ FieldSchema field = new FieldSchema (columnName , newColumnType , "" );
318+ schemaChangeManager .modifyColumnDataType (DATABASE , modifyColumnTbls , field );
319+
320+ Thread .sleep (3_000 );
321+ String columnType = getColumnType (modifyColumnTbls , columnName );
322+ Assert .assertEquals ("varchar" , columnType .toLowerCase ());
323+ }
324+
294325 @ Test
295326 public void testModifyColumnTypeWithDefaultAndChange ()
296327 throws IOException , IllegalArgumentException , InterruptedException {
0 commit comments