Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
Appreciate your advise on below:
Currently I have 2 data source A and B. These two are different data source. The link between these two data source is Date.
* My question :
I want to create applymap table for Data B., but I want to load the data B , based on Date in A. If there is no date in A it will not load the unused data in applyMap table B.
This is because Data in B are too huge almost millions records. So I dont want to load all data but load based on Date in A.
How can I do this in applymap function?
Thanks!
May be like this:
CheckTable:
LOAD DISTINCT DateFieldA
FROM SourceA;
MappingTable:
Mapping
LOAD Column1,
Column2
FROM SourceB
Where Exists(DateFieldA, DateFieldB);
TableA:
LOAD AllFields,
ApplyMap('MappingTable', ....) as ...
FROM SourceA;
why u need apply map?
You can just left join data A left join Data B.
keep both the table date fields as Date.
Hi,
Khushboo is right you need use Left Join to do this.
Regards
Hi Khusboo,
I have used applymap because i need the field value in Data B, meaning that there are combination in field in data A and B. If the combination field match i will do applymap.
The question that I asked because it takes time for me to load data for applymap table. So if i can drill down the criteria where it load data B based on date in A. If i can reduce the time of loading the mapping table it will be better way for me. FYI i have 6 mapping table and for one table it contains millions of records.
Currently for 1 month data it takes around 20 minutes to load the map table.
May be like this:
CheckTable:
LOAD DISTINCT DateFieldA
FROM SourceA;
MappingTable:
Mapping
LOAD Column1,
Column2
FROM SourceB
Where Exists(DateFieldA, DateFieldB);
TableA:
LOAD AllFields,
ApplyMap('MappingTable', ....) as ...
FROM SourceA;
Hi Sunny ,
It works for me. Thanks so much!!