@@ -68,7 +68,7 @@ pub(crate) const DOMAIN_METADATA_NAME: &str = "domainMetadata";
6868pub ( crate )  const  INTERNAL_DOMAIN_PREFIX :  & str  = "delta." ; 
6969
7070static  LOG_SCHEMA :  LazyLock < SchemaRef >  = LazyLock :: new ( || { 
71-     Arc :: new ( StructType :: new ( [ 
71+     Arc :: new ( StructType :: new_unchecked ( [ 
7272        StructField :: nullable ( ADD_NAME ,  Add :: to_schema ( ) ) , 
7373        StructField :: nullable ( REMOVE_NAME ,  Remove :: to_schema ( ) ) , 
7474        StructField :: nullable ( METADATA_NAME ,  Metadata :: to_schema ( ) ) , 
@@ -83,28 +83,28 @@ static LOG_SCHEMA: LazyLock<SchemaRef> = LazyLock::new(|| {
8383} ) ; 
8484
8585static  LOG_ADD_SCHEMA :  LazyLock < SchemaRef >  = LazyLock :: new ( || { 
86-     Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
86+     Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
8787        ADD_NAME , 
8888        Add :: to_schema ( ) , 
8989    ) ] ) ) 
9090} ) ; 
9191
9292static  LOG_COMMIT_INFO_SCHEMA :  LazyLock < SchemaRef >  = LazyLock :: new ( || { 
93-     Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
93+     Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
9494        COMMIT_INFO_NAME , 
9595        CommitInfo :: to_schema ( ) , 
9696    ) ] ) ) 
9797} ) ; 
9898
9999static  LOG_TXN_SCHEMA :  LazyLock < SchemaRef >  = LazyLock :: new ( || { 
100-     Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
100+     Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
101101        SET_TRANSACTION_NAME , 
102102        SetTransaction :: to_schema ( ) , 
103103    ) ] ) ) 
104104} ) ; 
105105
106106static  LOG_DOMAIN_METADATA_SCHEMA :  LazyLock < SchemaRef >  = LazyLock :: new ( || { 
107-     Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
107+     Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
108108        DOMAIN_METADATA_NAME , 
109109        DomainMetadata :: to_schema ( ) , 
110110    ) ] ) ) 
@@ -137,7 +137,9 @@ pub(crate) fn get_log_domain_metadata_schema() -> &'static SchemaRef {
137137/// This is useful for JSON conversion, as it allows us to wrap a dynamically maintained add action 
138138/// schema in a top-level "add" struct. 
139139pub ( crate )  fn  as_log_add_schema ( schema :  SchemaRef )  -> SchemaRef  { 
140-     Arc :: new ( StructType :: new ( [ StructField :: nullable ( ADD_NAME ,  schema) ] ) ) 
140+     Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
141+         ADD_NAME ,  schema, 
142+     ) ] ) ) 
141143} 
142144
143145#[ derive( Debug ,  Clone ,  PartialEq ,  Eq ,  ToSchema ) ]  
@@ -991,15 +993,15 @@ mod tests {
991993            . project ( & [ METADATA_NAME ] ) 
992994            . expect ( "Couldn't get metaData field" ) ; 
993995
994-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
996+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
995997            "metaData" , 
996-             StructType :: new ( [ 
998+             StructType :: new_unchecked ( [ 
997999                StructField :: not_null ( "id" ,  DataType :: STRING ) , 
9981000                StructField :: nullable ( "name" ,  DataType :: STRING ) , 
9991001                StructField :: nullable ( "description" ,  DataType :: STRING ) , 
10001002                StructField :: not_null ( 
10011003                    "format" , 
1002-                     StructType :: new ( [ 
1004+                     StructType :: new_unchecked ( [ 
10031005                        StructField :: not_null ( "provider" ,  DataType :: STRING ) , 
10041006                        StructField :: not_null ( 
10051007                            "options" , 
@@ -1025,9 +1027,9 @@ mod tests {
10251027            . project ( & [ ADD_NAME ] ) 
10261028            . expect ( "Couldn't get add field" ) ; 
10271029
1028-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
1030+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
10291031            "add" , 
1030-             StructType :: new ( [ 
1032+             StructType :: new_unchecked ( [ 
10311033                StructField :: not_null ( "path" ,  DataType :: STRING ) , 
10321034                StructField :: not_null ( 
10331035                    "partitionValues" , 
@@ -1067,7 +1069,7 @@ mod tests {
10671069    fn  deletion_vector_field ( )  -> StructField  { 
10681070        StructField :: nullable ( 
10691071            "deletionVector" , 
1070-             DataType :: struct_type ( [ 
1072+             DataType :: struct_type_unchecked ( [ 
10711073                StructField :: not_null ( "storageType" ,  DataType :: STRING ) , 
10721074                StructField :: not_null ( "pathOrInlineDv" ,  DataType :: STRING ) , 
10731075                StructField :: nullable ( "offset" ,  DataType :: INTEGER ) , 
@@ -1082,9 +1084,9 @@ mod tests {
10821084        let  schema = get_log_schema ( ) 
10831085            . project ( & [ REMOVE_NAME ] ) 
10841086            . expect ( "Couldn't get remove field" ) ; 
1085-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
1087+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
10861088            "remove" , 
1087-             StructType :: new ( [ 
1089+             StructType :: new_unchecked ( [ 
10881090                StructField :: not_null ( "path" ,  DataType :: STRING ) , 
10891091                StructField :: nullable ( "deletionTimestamp" ,  DataType :: LONG ) , 
10901092                StructField :: not_null ( "dataChange" ,  DataType :: BOOLEAN ) , 
@@ -1105,9 +1107,9 @@ mod tests {
11051107        let  schema = get_log_schema ( ) 
11061108            . project ( & [ CDC_NAME ] ) 
11071109            . expect ( "Couldn't get cdc field" ) ; 
1108-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
1110+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
11091111            "cdc" , 
1110-             StructType :: new ( [ 
1112+             StructType :: new_unchecked ( [ 
11111113                StructField :: not_null ( "path" ,  DataType :: STRING ) , 
11121114                StructField :: not_null ( 
11131115                    "partitionValues" , 
@@ -1126,9 +1128,9 @@ mod tests {
11261128        let  schema = get_log_schema ( ) 
11271129            . project ( & [ SIDECAR_NAME ] ) 
11281130            . expect ( "Couldn't get sidecar field" ) ; 
1129-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
1131+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
11301132            "sidecar" , 
1131-             StructType :: new ( [ 
1133+             StructType :: new_unchecked ( [ 
11321134                StructField :: not_null ( "path" ,  DataType :: STRING ) , 
11331135                StructField :: not_null ( "sizeInBytes" ,  DataType :: LONG ) , 
11341136                StructField :: not_null ( "modificationTime" ,  DataType :: LONG ) , 
@@ -1143,9 +1145,9 @@ mod tests {
11431145        let  schema = get_log_schema ( ) 
11441146            . project ( & [ CHECKPOINT_METADATA_NAME ] ) 
11451147            . expect ( "Couldn't get checkpointMetadata field" ) ; 
1146-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
1148+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
11471149            "checkpointMetadata" , 
1148-             StructType :: new ( [ 
1150+             StructType :: new_unchecked ( [ 
11491151                StructField :: not_null ( "version" ,  DataType :: LONG ) , 
11501152                tags_field ( ) , 
11511153            ] ) , 
@@ -1159,9 +1161,9 @@ mod tests {
11591161            . project ( & [ "txn" ] ) 
11601162            . expect ( "Couldn't get transaction field" ) ; 
11611163
1162-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
1164+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
11631165            "txn" , 
1164-             StructType :: new ( [ 
1166+             StructType :: new_unchecked ( [ 
11651167                StructField :: not_null ( "appId" ,  DataType :: STRING ) , 
11661168                StructField :: not_null ( "version" ,  DataType :: LONG ) , 
11671169                StructField :: nullable ( "lastUpdated" ,  DataType :: LONG ) , 
@@ -1176,9 +1178,9 @@ mod tests {
11761178            . project ( & [ "commitInfo" ] ) 
11771179            . expect ( "Couldn't get commitInfo field" ) ; 
11781180
1179-         let  expected = Arc :: new ( StructType :: new ( vec ! [ StructField :: nullable( 
1181+         let  expected = Arc :: new ( StructType :: new_unchecked ( vec ! [ StructField :: nullable( 
11801182            "commitInfo" , 
1181-             StructType :: new ( vec![ 
1183+             StructType :: new_unchecked ( vec![ 
11821184                StructField :: nullable( "timestamp" ,  DataType :: LONG ) , 
11831185                StructField :: nullable( "inCommitTimestamp" ,  DataType :: LONG ) , 
11841186                StructField :: nullable( "operation" ,  DataType :: STRING ) , 
@@ -1199,9 +1201,9 @@ mod tests {
11991201        let  schema = get_log_schema ( ) 
12001202            . project ( & [ DOMAIN_METADATA_NAME ] ) 
12011203            . expect ( "Couldn't get domainMetadata field" ) ; 
1202-         let  expected = Arc :: new ( StructType :: new ( [ StructField :: nullable ( 
1204+         let  expected = Arc :: new ( StructType :: new_unchecked ( [ StructField :: nullable ( 
12031205            "domainMetadata" , 
1204-             StructType :: new ( [ 
1206+             StructType :: new_unchecked ( [ 
12051207                StructField :: not_null ( "domain" ,  DataType :: STRING ) , 
12061208                StructField :: not_null ( "configuration" ,  DataType :: STRING ) , 
12071209                StructField :: not_null ( "removed" ,  DataType :: BOOLEAN ) , 
@@ -1526,7 +1528,7 @@ mod tests {
15261528
15271529    #[ test]  
15281530    fn  test_metadata_try_new ( )  { 
1529-         let  schema = StructType :: new ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
1531+         let  schema = StructType :: new_unchecked ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
15301532        let  config = HashMap :: from ( [ ( "key1" . to_string ( ) ,  "value1" . to_string ( ) ) ] ) ; 
15311533
15321534        let  metadata = Metadata :: try_new ( 
@@ -1551,7 +1553,7 @@ mod tests {
15511553
15521554    #[ test]  
15531555    fn  test_metadata_try_new_default ( )  { 
1554-         let  schema = StructType :: new ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
1556+         let  schema = StructType :: new_unchecked ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
15551557        let  metadata = Metadata :: try_new ( None ,  None ,  schema,  vec ! [ ] ,  0 ,  HashMap :: new ( ) ) . unwrap ( ) ; 
15561558
15571559        assert ! ( !metadata. id. is_empty( ) ) ; 
@@ -1561,7 +1563,7 @@ mod tests {
15611563
15621564    #[ test]  
15631565    fn  test_metadata_unique_ids ( )  { 
1564-         let  schema = StructType :: new ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
1566+         let  schema = StructType :: new_unchecked ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
15651567        let  m1 = Metadata :: try_new ( None ,  None ,  schema. clone ( ) ,  vec ! [ ] ,  0 ,  HashMap :: new ( ) ) . unwrap ( ) ; 
15661568        let  m2 = Metadata :: try_new ( None ,  None ,  schema,  vec ! [ ] ,  0 ,  HashMap :: new ( ) ) . unwrap ( ) ; 
15671569        assert_ne ! ( m1. id,  m2. id) ; 
@@ -1648,7 +1650,7 @@ mod tests {
16481650    #[ test]  
16491651    fn  test_metadata_into_engine_data ( )  { 
16501652        let  engine = ExprEngine :: new ( ) ; 
1651-         let  schema = StructType :: new ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
1653+         let  schema = StructType :: new_unchecked ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
16521654
16531655        let  test_metadata = Metadata :: try_new ( 
16541656            Some ( "test" . to_string ( ) ) , 
@@ -1699,7 +1701,7 @@ mod tests {
16991701    #[ test]  
17001702    fn  test_metadata_with_log_schema ( )  { 
17011703        let  engine = ExprEngine :: new ( ) ; 
1702-         let  schema = StructType :: new ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
1704+         let  schema = StructType :: new_unchecked ( [ StructField :: not_null ( "id" ,  DataType :: INTEGER ) ] ) ; 
17031705
17041706        let  metadata = Metadata :: try_new ( 
17051707            Some ( "table" . to_string ( ) ) , 
0 commit comments