Home > other >  In the hive mapjoin equivalent link
In the hive mapjoin equivalent link

Time:10-04

I want to ask next, I now have two tables, a big, a very small, so plan to use mapjoin, and large table in the field is a field with small table b contains and contained relationship, so the big table and small table is not equivalent links, so use mapjoin is more convenient, but when I was in the query data, but did not find you want data,,
Example: a field data is: I, I eat, I went to sleep,,
B field data for:
HiveQL: select/* + mapjoin (test1) */test1. B, test2. A from test1 join test2 where test1. Like a '%' + test2. B + '%';
Above this is not I want, so I tried it in several other functions:
Where find_in_set (test1. B, test2. A) & gt; 0
Where the locate (test2. A, test1. B, 0) & gt; 0
Where instr (test2. A, test1. B) & gt; 0
All the above several ways to check out what I want results in (a "I ate"), according to the logic, these methods should be,
So you know why?
Have any Suggestions?

CodePudding user response:

Well, for a long time, I answer by oneself, maybe not quite right, but is, indeed, I measured,,,
When using mapjoin, small table data in the first row will not be as a filter conditions,,,, don't know whether I Hive bugs, can only for our table happens!
My solution is that, the first line of the small table, add a row casually,,,
OK,,, solved,
  • Related