Hi all,
I wanted to compare two different tables with each other via a minus/except comparison.
However I noticed that I get a different amount of rows (~1500 in the first and ~470 in the second case) , if I run
Select * from tab1 minus Select * from tab2
vs
Select col1…coln from tab1 minus Select col1…coln from tab2
I copied all the column names from the processor, so I am quite certain, that the difference is not due to the fact, that I have forgotten a column.
If I add a query processor between the processors that provide the input and the minus/except processor, and I specify the exact columns, I can do the Select * in the minus comparison and get 470 rows as well.
Spontanenously, the following comes to my mind: I could imagine that ONE DATA’s hidden __ROW_ID__
column is playing tricks on you here. It seems as if you are unknowingly taking __ROW_ID__
into account in the first case, and likely get all rows of tab1, whereas you do what you actually want to do in the second case.
This theory would need to be verified by debugging the server code. You might also try to select that special column and rename it via an alias to see whether your queries can see it.
I wasn’t able to select the column, but that would explain the behavior indeed
You actually can filter out the __ROW_ID__
with the following processor’s code. You can import it by clicking on “Import” in a Workflow, and pasting in the processor’s code.
JE9EQ0xCUkQkeyJ0eXBlIjoibm9kZXMiLCJkYXRhIjp7Im5vZGVzIjpbeyJpZCI6IjIzNGRhMGE3LTE4NmItNDYxNy1hZmNkLTdkMzU4NzY1NzhiNiIsInByb2Nlc3NvciI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAyLTAwMDAwMDAwMDAwMiIsImNvbmZpZyI6eyJleGNsdWRlIjpbeyJuYW1lIjoiX19ST1dfSURfXyJ9XSwidGFibGVuYW1lIjoiIiwiYWxsb3dFbXB0eU91dCI6ZmFsc2V9LCJyZXN1bHQiOm51bGwsIm9wdGlvbnMiOnsiY29uZmlnRWRpdEV4cGVydE1vZGVFbmFibGVkIjpmYWxzZX0sIngiOi0xMzYsInkiOi0xOCwibmFtZSI6IkV4Y2x1ZGUgQ29sdW1ucyAocm93IGlkKSIsImNvbG9yIjp7Im5hbWUiOiJjeWFuIDcwMCIsImhleCI6IiMwMDk3YTciLCJzdHlsZSI6eyJjb2xvciI6InJnYigyNTUsMjU1LDI1NSkiLCJiYWNrZ3JvdW5kLWNvbG9yIjoicmdiKDA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nVsbH0sImNvbmZpZ1N0YXR1cyI6eyIkJHN0YXRlIjp7InN0YXR1cyI6MSwidmFsdWUiOm51bGx9fX1dLCJlZGdlcyI6W10sImdyb3VwcyI6W10sIm5vZGVOb3RlcyI6e319fQ==
@ThomasZ Can you maybe try to filter out the ROW_ID using this processor from both input tables you are trying to compare, and see if you still get a differing number of rows compared to manually selecting them?