github.com/matrixorigin/matrixone@v1.2.0/pkg/sql/plan/function/init.go (about)

     1  // Copyright 2021 - 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 function
    16  
    17  var AndFunctionEncodedID = encodeOverloadID(AND, 0)
    18  var AndFunctionName = "and"
    19  var EqualFunctionName = "="
    20  var EqualFunctionEncodedID = encodeOverloadID(EQUAL, 0)
    21  var SerialFunctionEncodeID = encodeOverloadID(SERIAL, 0)
    22  var GroupConcatFunctionID = encodeOverloadID(GROUP_CONCAT, 0)
    23  var AggSumOverloadID = encodeOverloadID(SUM, 0)
    24  
    25  var InFunctionEncodedID = encodeOverloadID(IN, 0)
    26  var InFunctionName = "in"
    27  var PrefixInFunctionEncodedID = encodeOverloadID(PREFIX_IN, 0)
    28  var PrefixInFunctionName = "prefix_in"
    29  var PrefixEqualFunctionEncodedID = encodeOverloadID(PREFIX_EQ, 0)
    30  var PrefixEqualFunctionName = "prefix_eq"
    31  var L2DistanceFunctionEncodedID = encodeOverloadID(L2_DISTANCE, 0)
    32  
    33  func init() {
    34  	// init fixed type cast rule for binary operator like
    35  	// +, -, x, /, div, >=, =, != and so on.
    36  	initFixed1()
    37  	initFixed2()
    38  
    39  	// init implicit type cast rule.
    40  	initFixed3()
    41  
    42  	// init supported functions.
    43  	initAllSupportedFunctions()
    44  }