Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5869

LEAST_RESTRICTIVE does not use inner type of MEASURE for comparisons

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.36.0
    • None

    Description

      If you have a function with return type LEAST_RESTRICTIVE, that takes two arguments, and one of these arguments is an INTEGER and the other is a MEASURE<DOUBLE> you should expect that the latter is less restrictive. However, the logic in SqlTypeUtil#canCastFrom does not consider the case of measures where the type that should be used for comparisons is nested within. Because the SqlTypeFamily of a measure is ANY, that method will always return TRUE.

      I have a small fix I will open a PR for, any comments would be appreciated.

      Attachments

        Issue Links

          Activity

            People

              tanclary Tanner Clary
              tanclary Tanner Clary
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: