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

When generating code for a function call, take the inferred operand type into account

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.27.0
    • Component/s: None
    • Labels:
      None

      Description

      When generating code for a function call, take the inferred operand type into account. If we don't do this, the Java code we generate for CONCAT(CAST(NULL AS ANY), 'x') does not compile, because the first parameter is of type Object; it needs to be String (based on the inferred operand type of VARCHAR).

      We achieve this by using SqlOperator.operandTypeInference at validate time, storing the list of inferred operand types for the call, then using that list (if available) during code generation.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: