@@ -275,25 +275,25 @@ private long WriteMetadata(BinaryWriter writer, Schema schema, int col, IChannel
275
275
// track of the location and size of each for when we write the metadata table of contents.
276
276
// (To be clear, this specific layout is not required by the format.)
277
277
278
- foreach ( var pair in schema . GetMetadataTypes ( col ) )
278
+ foreach ( var metaColumn in schema [ col ] . Metadata . Schema )
279
279
{
280
- _host . Check ( ! string . IsNullOrEmpty ( pair . Key ) , "Metadata with null or empty kind detected, disallowed" ) ;
281
- _host . Check ( pair . Value != null , "Metadata with null type detected, disallowed" ) ;
282
- if ( ! kinds . Add ( pair . Key ) )
283
- throw _host . Except ( "Metadata with duplicate kind '{0}' encountered, disallowed" , pair . Key , schema [ col ] . Name ) ;
284
- args [ 3 ] = pair . Key ;
285
- args [ 4 ] = pair . Value ;
286
- IValueCodec codec = ( IValueCodec ) methInfo . MakeGenericMethod ( pair . Value . RawType ) . Invoke ( this , args ) ;
280
+ _host . Check ( ! string . IsNullOrEmpty ( metaColumn . Name ) , "Metadata with null or empty kind detected, disallowed" ) ;
281
+ _host . Check ( metaColumn . Type != null , "Metadata with null type detected, disallowed" ) ;
282
+ if ( ! kinds . Add ( metaColumn . Name ) )
283
+ throw _host . Except ( "Metadata with duplicate kind '{0}' encountered, disallowed" , metaColumn . Name , schema [ col ] . Name ) ;
284
+ args [ 3 ] = metaColumn . Name ;
285
+ args [ 4 ] = metaColumn . Type ;
286
+ IValueCodec codec = ( IValueCodec ) methInfo . MakeGenericMethod ( metaColumn . Type . RawType ) . Invoke ( this , args ) ;
287
287
if ( codec == null )
288
288
{
289
289
// Nothing was written.
290
290
ch . Warning ( "Could not get codec for type {0}, dropping column '{1}' index {2} metadata kind '{3}'" ,
291
- pair . Value , schema [ col ] . Name , col , pair . Key ) ;
291
+ metaColumn . Type , schema [ col ] . Name , col , metaColumn . Name ) ;
292
292
continue ;
293
293
}
294
294
offsets . Add ( writer . BaseStream . Position ) ;
295
295
_host . CheckIO ( offsets [ offsets . Count - 1 ] > offsets [ offsets . Count - 2 ] , "Bad offsets detected during write" ) ;
296
- metadataInfos . Add ( Tuple . Create ( pair . Key , codec , ( CompressionKind ) args [ 5 ] ) ) ;
296
+ metadataInfos . Add ( Tuple . Create ( metaColumn . Name , codec , ( CompressionKind ) args [ 5 ] ) ) ;
297
297
count ++ ;
298
298
}
299
299
if ( metadataInfos . Count == 0 )
0 commit comments