0

I have 2 dataframes that I'm doing a multi-column join. The first pair of columns is doing an equal comparison and the second pair is a not-equals comparison. The code looks like this:

val arule_1w = itemLHS
      .join(itemRHS, itemLHS("CUST_ID") === itemRHS("CUST_ID") && itemLHS("LHS") != itemRHS("RHS")

The resulting data still has rows that contains itemLHS("LHS") = itemRHS("RHS"), which it shouldn't, with the not-equal join. It maybe user error as well but all my research tells me that format is correct. All datatypes are string values.

Thanks for your help!

2 Answers 2

4

Correct method is =!= not !=.

Sign up to request clarification or add additional context in comments.

3 Comments

I've tried that and it throws the following error: cannot resolve '((CUST_ID = CUST_ID) && LHS)' due to data type mismatch: differing types in '((CUST_ID = CUST_ID) && LHS)' (boolean and string). It's like it doesn't understand what !== is.
Oh it is a precedence issue. Try =!=.
why in the world is it than OK with != but ignores it!!
-1

Used below syntaxt itemLHS("LHS") !== itemRHS("RHS")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.