Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a few tables and want to model them as a star schema for better perfomance.
InvoiceNo | CustomerNo |
---|---|
1234 | 345 |
354 | 654 |
DueDate | InvoiceAmount | CustomerNo |
---|---|---|
10/12/2012 | 3456 | 345 |
12/12/2012 | 8979 | 654 |
CustomerNo | Name | Address |
---|---|---|
345 | William Bonney | null |
654 | John Dillinger | 33 Liberty Street |
How can I join just the fields InvoiceNo, InvoiceAmount and CustomerNo into one fact table? When first load all two or three fields from the tables and then join just the fields I want my machine with 8GB RAM freezes. If I ommit the joins I'm able to load the full dataset. Any help is appreciated!
Try this:
T1:
LOAD InvoiceNo, CustomerNo FROM table1;
T2:
join (T1)
LOAD CustomerNo FROM table2;
T3:
JOIN (T3)
LOAD CustomerNo, Name, Address from table3;
drop fields Address, Name;
Try this:
T1:
LOAD InvoiceNo, CustomerNo FROM table1;
T2:
join (T1)
LOAD CustomerNo FROM table2;
T3:
JOIN (T3)
LOAD CustomerNo, Name, Address from table3;
drop fields Address, Name;
I assume you can have multiple InvoiceNo per CustomerNo, right?
How do you want to link a InvoiceNo to a certain InvoiceAmount then, if the only key is the CustomerNo?
Thank you for replying!
This is what I'm doing, except the drop fields part.
What is the purpose of droping name and address? Can't I drop the whole T3 table?