private void validateJoinCondition(RexNode operand) { if (!(operand instanceof RexCall)) { throw new SamzaException("SQL Query is not supported. Join condition operand " + operand + " is of type " + operand.getClass()); } RexCall condition = (RexCall) operand; if (condition.isAlwaysTrue()) { throw new SamzaException("Query results in a cross join, which is not supported. Please optimize the query." + " It is expected that the joins should include JOIN ON operator in the sql query."); } if (condition.getKind() != SqlKind.EQUALS && condition.getKind() != SqlKind.AND) { throw new SamzaException("Only equi-joins and AND operator is supported in join condition."); } }
private void validateJoinCondition(RexNode operand) { if (!(operand instanceof RexCall)) { throw new SamzaException("SQL Query is not supported. Join condition operand " + operand + " is of type " + operand.getClass()); } RexCall condition = (RexCall) operand; if (condition.isAlwaysTrue()) { throw new SamzaException("Query results in a cross join, which is not supported. Please optimize the query." + " It is expected that the joins should include JOIN ON operator in the sql query."); } if (condition.getKind() != SqlKind.EQUALS && condition.getKind() != SqlKind.AND) { throw new SamzaException("Only equi-joins and AND operator is supported in join condition."); } }
when(mockJoin.getRight()).thenReturn(mockRightInput); RexCall mockJoinCondition = mock(RexCall.class); when(mockJoinCondition.isAlwaysTrue()).thenReturn(false); when(mockJoinCondition.getKind()).thenReturn(SqlKind.EQUALS); when(mockJoin.getCondition()).thenReturn(mockJoinCondition);