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

The "rowTypeCoercion" for "SET" operations should be "or" relationship

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • core

    Description

      In org.apache.calcite.sql.validate.implicit.TypeCoercionImpl#rowTypeCoercion#124:

      case UNION:
      case INTERSECT:
      case EXCEPT:
        // Set operations are binary for now.
        final SqlCall operand0 = ((SqlCall) query).operand(0);
        final SqlCall operand1 = ((SqlCall) query).operand(1);
        final boolean coerced = rowTypeCoercion(scope, operand0, columnIndex, targetType)
            && rowTypeCoercion(scope, operand1, columnIndex, targetType);
      

      Seems the coerced should be "||", not "&&"

      Attachments

        Issue Links

          Activity

            People

              Aron.tao Jiatao Tao
              Aron.tao Jiatao Tao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m