@@ -149,18 +149,18 @@ private static void PrintSchema(TextWriter writer, Arguments args, Schema schema
149
149
150
150
if ( ! args . ShowSlots )
151
151
continue ;
152
- if ( ! type . IsKnownSizeVector )
152
+ if ( ! type . IsKnownSizeVector ( ) )
153
153
continue ;
154
154
ColumnType typeNames ;
155
155
if ( ( typeNames = schema [ col ] . Metadata . Schema . GetColumnOrNull ( MetadataUtils . Kinds . SlotNames ) ? . Type ) == null )
156
156
continue ;
157
- if ( typeNames . VectorSize != type . VectorSize || ! ( typeNames . ItemType is TextType ) )
157
+ if ( typeNames . GetVectorSize ( ) != type . GetVectorSize ( ) || ! ( typeNames . GetItemType ( ) is TextType ) )
158
158
{
159
159
Contracts . Assert ( false , "Unexpected slot names type" ) ;
160
160
continue ;
161
161
}
162
162
schema [ col ] . Metadata . GetValue ( MetadataUtils . Kinds . SlotNames , ref names ) ;
163
- if ( names . Length != type . VectorSize )
163
+ if ( names . Length != type . GetVectorSize ( ) )
164
164
{
165
165
Contracts . Assert ( false , "Unexpected length of slot names vector" ) ;
166
166
continue ;
@@ -193,10 +193,10 @@ private static void ShowMetadata(IndentedTextWriter itw, Schema schema, int col,
193
193
itw . Write ( "Metadata '{0}': {1}" , metaColumn . Name , type ) ;
194
194
if ( showVals )
195
195
{
196
- if ( ! type . IsVector )
196
+ if ( ! ( type is VectorType vectorType ) )
197
197
ShowMetadataValue ( itw , schema , col , metaColumn . Name , type ) ;
198
198
else
199
- ShowMetadataValueVec ( itw , schema , col , metaColumn . Name , type ) ;
199
+ ShowMetadataValueVec ( itw , schema , col , metaColumn . Name , vectorType ) ;
200
200
}
201
201
itw . WriteLine ( ) ;
202
202
}
@@ -210,7 +210,7 @@ private static void ShowMetadataValue(IndentedTextWriter itw, Schema schema, int
210
210
Contracts . Assert ( 0 <= col && col < schema . Count ) ;
211
211
Contracts . AssertNonEmpty ( kind ) ;
212
212
Contracts . AssertValue ( type ) ;
213
- Contracts . Assert ( ! type . IsVector ) ;
213
+ Contracts . Assert ( ! ( type is VectorType ) ) ;
214
214
215
215
if ( ! type . IsStandardScalar ( ) && ! ( type is KeyType ) )
216
216
{
@@ -230,7 +230,7 @@ private static void ShowMetadataValue<T>(IndentedTextWriter itw, Schema schema,
230
230
Contracts . Assert ( 0 <= col && col < schema . Count ) ;
231
231
Contracts . AssertNonEmpty ( kind ) ;
232
232
Contracts . AssertValue ( type ) ;
233
- Contracts . Assert ( ! type . IsVector ) ;
233
+ Contracts . Assert ( ! ( type is VectorType ) ) ;
234
234
Contracts . Assert ( type . RawType == typeof ( T ) ) ;
235
235
236
236
var conv = Conversions . Instance . GetStringConversion < T > ( type ) ;
@@ -243,34 +243,32 @@ private static void ShowMetadataValue<T>(IndentedTextWriter itw, Schema schema,
243
243
itw . Write ( ": '{0}'" , sb ) ;
244
244
}
245
245
246
- private static void ShowMetadataValueVec ( IndentedTextWriter itw , Schema schema , int col , string kind , ColumnType type )
246
+ private static void ShowMetadataValueVec ( IndentedTextWriter itw , Schema schema , int col , string kind , VectorType type )
247
247
{
248
248
Contracts . AssertValue ( itw ) ;
249
249
Contracts . AssertValue ( schema ) ;
250
250
Contracts . Assert ( 0 <= col && col < schema . Count ) ;
251
251
Contracts . AssertNonEmpty ( kind ) ;
252
252
Contracts . AssertValue ( type ) ;
253
- Contracts . Assert ( type . IsVector ) ;
254
253
255
254
if ( ! type . ItemType . IsStandardScalar ( ) && ! ( type . ItemType is KeyType ) )
256
255
{
257
256
itw . Write ( ": Can't display value of this type" ) ;
258
257
return ;
259
258
}
260
259
261
- Action < IndentedTextWriter , Schema , int , string , ColumnType > del = ShowMetadataValueVec < int > ;
260
+ Action < IndentedTextWriter , Schema , int , string , VectorType > del = ShowMetadataValueVec < int > ;
262
261
var meth = del . GetMethodInfo ( ) . GetGenericMethodDefinition ( ) . MakeGenericMethod ( type . ItemType . RawType ) ;
263
262
meth . Invoke ( null , new object [ ] { itw , schema , col , kind , type } ) ;
264
263
}
265
264
266
- private static void ShowMetadataValueVec < T > ( IndentedTextWriter itw , Schema schema , int col , string kind , ColumnType type )
265
+ private static void ShowMetadataValueVec < T > ( IndentedTextWriter itw , Schema schema , int col , string kind , VectorType type )
267
266
{
268
267
Contracts . AssertValue ( itw ) ;
269
268
Contracts . AssertValue ( schema ) ;
270
269
Contracts . Assert ( 0 <= col && col < schema . Count ) ;
271
270
Contracts . AssertNonEmpty ( kind ) ;
272
271
Contracts . AssertValue ( type ) ;
273
- Contracts . Assert ( type . IsVector ) ;
274
272
Contracts . Assert ( type . ItemType . RawType == typeof ( T ) ) ;
275
273
276
274
var conv = Conversions . Instance . GetStringConversion < T > ( type . ItemType ) ;
0 commit comments