@@ -231,6 +231,14 @@ impl Schema {
231231 ( false , 0 )
232232 }
233233 }
234+
235+ pub ( crate ) fn get_entities ( & self ) -> & Vec < schema_pb:: EntityMeta > {
236+ self . entities . as_ref ( )
237+ }
238+
239+ pub ( crate ) fn get_relations ( & self ) -> & Vec < schema_pb:: RelationMeta > {
240+ self . relations . as_ref ( )
241+ }
234242}
235243
236244impl From < Schema > for schema_pb:: Schema {
@@ -492,33 +500,36 @@ impl JsonIO for Schema {
492500// }
493501fn convert_data_type ( data_type_int : i64 ) -> serde_json:: Value {
494502 use serde_json:: json;
495- match data_type_int {
503+ let dt = match data_type_int {
496504 // Primitive types mapping
497- 0 => json ! ( { "primitive_type " : "DT_BOOL" } ) , // BOOLEAN
498- 1 => json ! ( { "primitive_type " : "DT_SIGNED_INT32" } ) , // INT32
499- 2 => json ! ( { "primitive_type " : "DT_SIGNED_INT64" } ) , // INT64
500- 3 => json ! ( { "primitive_type " : "DT_DOUBLE" } ) , // DOUBLE
505+ 0 => json ! ( { "PrimitiveType " : 5 } ) , // BOOLEAN
506+ 1 => json ! ( { "PrimitiveType " : 1 } ) , // INT32
507+ 2 => json ! ( { "PrimitiveType " : 3 } ) , // INT64
508+ 3 => json ! ( { "PrimitiveType " : 7 } ) , // DOUBLE
501509
502510 // String type mapping
503- 4 => json ! ( { "string " : { "long_text " : { } } } ) , // STRING
511+ 4 => json ! ( { "String " : { "item " : { "LongText" : { } } } } ) , // STRING
504512
505513 // Array types mapping
506- 6 => json ! ( { "array" : { "component_type" : { "primitive_type" : "DT_SIGNED_INT32" } } } ) , // INT32_ARRAY
507- 7 => json ! ( { "array" : { "component_type" : { "primitive_type" : "DT_SIGNED_INT64" } } } ) , // INT64_ARRAY
508- 8 => json ! ( { "array" : { "component_type" : { "primitive_type" : "DT_DOUBLE" } } } ) , // DOUBLE_ARRAY
509- 9 => json ! ( { "array" : { "component_type" : { "string" : { "long_text" : { } } } } } ) , // STRING_ARRAY
514+ 6 => json ! ( { "Array" : { "component_type" : { "item" : { "PrimitiveType" : 1 } } } , "max_length" : 1024 } ) , // INT32_ARRAY
515+ 7 => json ! ( { "Array" : { "component_type" : { "item" : { "PrimitiveType" : 3 } } } , "max_length" : 1024 } ) , // INT64_ARRAY
516+ 8 => json ! ( { "Array" : { "component_type" : { "item" : { "PrimitiveType" : 7 } } } , "max_length" : 1024 } ) , // DOUBLE_ARRAY
517+ 9 => {
518+ json ! ( { "Array" : { "component_type" : { "item" : { "String" : { "item" : { "LongText" : { } } } } } , "max_length" : 1024 } } )
519+ } // STRING_ARRAY
510520
511521 // None type mapping
512- 11 => json ! ( { "primitive_type " : "DT_NULL" } ) , // NONE
522+ 11 => json ! ( { "PrimitiveType " : 8 } ) , // NONE
513523
514524 // Temporal types mapping
515- 12 => json ! ( { "temporal " : { "date32 " : { } } } ) , // DATE32
516- 13 => json ! ( { "temporal " : { "time32 ": { } } } ) , // TIME32
517- 14 => json ! ( { "temporal " : { "timestamp " : { } } } ) , // TIMESTAMP
525+ 12 => json ! ( { "Temporal " : { "item " : { "Date32" : { } } } } ) , // DATE32
526+ 13 => json ! ( { "Temporal " : { "item" : { "Time32 ": { } } } } ) , // TIME32
527+ 14 => json ! ( { "Temporal " : { "item " : { "Timestamp" : { } } } } ) , // TIMESTAMP
518528
519529 // Other types handling (default to a NONE-like type if applicable)
520- _ => json ! ( { "primitive_type" : "DT_ANY" } ) , // NONE or unsupported types
521- }
530+ _ => json ! ( { "PrimitiveType" : 0 } ) , // NONE or unsupported types
531+ } ;
532+ json ! ( { "item" : dt} )
522533}
523534
524535/// To define the options of required columns by the computing node of the query plan.
0 commit comments