@@ -56,6 +56,18 @@ private void validateTableSchemaExec(Map<String, String> options) {
5656 new TableSchema (1 , fields , 10 , partitionKeys , primaryKeys , options , "" ));
5757 }
5858
59+ private void validateBlobSchema (Map <String , String > options , List <String > partitions ) {
60+ List <DataField > fields =
61+ Arrays .asList (
62+ new DataField (0 , "f0" , DataTypes .INT ()),
63+ new DataField (1 , "f1" , DataTypes .INT ()),
64+ new DataField (2 , "f2" , DataTypes .BLOB ()),
65+ new DataField (3 , "f3" , DataTypes .STRING ()));
66+ options .put (BUCKET .key (), String .valueOf (-1 ));
67+ validateTableSchema (
68+ new TableSchema (1 , fields , 10 , partitions , Collections .emptyList (), options , "" ));
69+ }
70+
5971 @ Test
6072 public void testOnlyTimestampMillis () {
6173 Map <String , String > options = new HashMap <>();
@@ -122,4 +134,21 @@ public void testRecordLevelTimeField() {
122134 .hasMessageContaining (
123135 "The record level time field type should be one of INT, BIGINT, or TIMESTAMP, but field type is STRING." );
124136 }
137+
138+ @ Test
139+ public void testBlobTableSchema () {
140+ Map <String , String > options = new HashMap <>();
141+
142+ // 1. must set row-tracking = true and data-evolution = true
143+ options .put (CoreOptions .ROW_TRACKING_ENABLED .key (), "true" );
144+ assertThatThrownBy (() -> validateBlobSchema (options , Collections .emptyList ()))
145+ .hasMessage ("Data evolution config must enabled for table with BLOB type column." );
146+
147+ // 2. blob column cannot be part of partition keys
148+ options .clear ();
149+ options .put (CoreOptions .ROW_TRACKING_ENABLED .key (), "true" );
150+ options .put (CoreOptions .DATA_EVOLUTION_ENABLED .key (), "true" );
151+ assertThatThrownBy (() -> validateBlobSchema (options , Collections .singletonList ("f2" )))
152+ .hasMessage ("The BLOB type column can not be part of partition keys." );
153+ }
125154}
0 commit comments