github.com/matrixorigin/matrixone@v0.7.0/pkg/vm/engine/gob.go (about)

     1  // Copyright 2022 Matrix Origin
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package engine
    16  
    17  import (
    18  	"encoding/gob"
    19  
    20  	"github.com/matrixorigin/matrixone/pkg/container/types"
    21  	"github.com/matrixorigin/matrixone/pkg/pb/plan"
    22  )
    23  
    24  func init() {
    25  
    26  	// register TableDef types
    27  	gob.Register(new(ViewDef))
    28  	gob.Register(new(CommentDef))
    29  	gob.Register(new(PartitionDef))
    30  	gob.Register(new(AttributeDef))
    31  	gob.Register(new(IndexTableDef))
    32  	gob.Register(new(PropertiesDef))
    33  	gob.Register(new(ConstraintDef))
    34  
    35  	// register vector column types
    36  	gob.Register([]bool{})
    37  	gob.Register([]int8{})
    38  	gob.Register([]int16{})
    39  	gob.Register([]int32{})
    40  	gob.Register([]int64{})
    41  	gob.Register([]uint8{})
    42  	gob.Register([]uint16{})
    43  	gob.Register([]uint32{})
    44  	gob.Register([]uint64{})
    45  	gob.Register([]float32{})
    46  	gob.Register([]float64{})
    47  	gob.Register([]string{})
    48  	gob.Register([][]any{})
    49  	gob.Register([]types.Type{})
    50  	gob.Register([]types.Date{})
    51  	gob.Register([]types.Datetime{})
    52  	gob.Register([]types.Timestamp{})
    53  	gob.Register([]types.Decimal64{})
    54  	gob.Register([]types.Decimal128{})
    55  
    56  	// plan types
    57  	gob.Register(&plan.Expr_C{})
    58  	gob.Register(&plan.Expr_P{})
    59  	gob.Register(&plan.Expr_V{})
    60  	gob.Register(&plan.Expr_Col{})
    61  	gob.Register(&plan.Expr_F{})
    62  	gob.Register(&plan.Expr_Sub{})
    63  	gob.Register(&plan.Expr_Corr{})
    64  	gob.Register(&plan.Expr_T{})
    65  	gob.Register(&plan.Expr_List{})
    66  	gob.Register(&plan.Const_I8Val{})
    67  	gob.Register(&plan.Const_I16Val{})
    68  	gob.Register(&plan.Const_I32Val{})
    69  	gob.Register(&plan.Const_I64Val{})
    70  	gob.Register(&plan.Const_Dval{})
    71  	gob.Register(&plan.Const_Sval{})
    72  	gob.Register(&plan.Const_Bval{})
    73  	gob.Register(&plan.Const_U8Val{})
    74  	gob.Register(&plan.Const_U16Val{})
    75  	gob.Register(&plan.Const_U32Val{})
    76  	gob.Register(&plan.Const_U64Val{})
    77  	gob.Register(&plan.Const_Fval{})
    78  	gob.Register(&plan.Const_Dateval{})
    79  	gob.Register(&plan.Const_Timeval{})
    80  	gob.Register(&plan.Const_Datetimeval{})
    81  	gob.Register(&plan.Const_Decimal64Val{})
    82  	gob.Register(&plan.Const_Decimal128Val{})
    83  	gob.Register(&plan.Const_Timestampval{})
    84  	gob.Register(&plan.Const_Jsonval{})
    85  	gob.Register(&plan.Const_Defaultval{})
    86  	gob.Register(&plan.Default{})
    87  	gob.Register(&plan.OnUpdate{})
    88  }