# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
# http:# www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Template data/configuration file for ComparisonFunctions.java for
# comparison functions--currently, for primitive numeric types, for Bit/Boolean,
# and for character and byte strings:

# Each group (value in "typeGroups" array is for types that can be compared to each
# other:
# - "comparables" is types in group
# - "mode" is comparison mode (case of code needed to compare):
#   - "primitive" - comparable with Java primitive-type "<", "==", and ">" operators
#   - "varString" - comparable with ByteFunctionHelpers.compare(...)

{
  typeGroups: [

    # Group:  Drill "Bit"/SQL BOOLEAN (represented with Java primitive type)
    {comparables: [
      "Bit"
      ],
      mode: "primitive"},

    # Group:  Numeric types comparable with Java primitive-type operators:
    {comparables: ["Int"], mode: "primitive"},
    {comparables: ["BigInt"], mode: "primitive"},
    {comparables: ["Float4"], mode: "primitive"},
    {comparables: ["Float8"], mode: "primitive"},

    # Date/time types other than IntervalDay or Interval (comparable with Java
    # primitive-type operators):

    {comparables: ["TimeStamp"], mode: "primitive"},
    {comparables: ["Date"], mode: "primitive"},
    {comparables: ["Time"], mode: "primitive"},
    {comparables: ["IntervalYear"], mode: "primitive"},

    {comparables: ["IntervalDay"], mode: "intervalDay"},
    {comparables: ["Interval"], mode: "intervalNameThis"},


    # Group:  Variable-length string types whose values can be compared using
    # ByteFunctionHelpers.compare(...)
    {comparables: [
      "VarChar",
      "VarBinary"
      ],
      mode: "varString"}

  ]
}
