Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
what type of situations resident load will be used?
If you have to do some calculation and create another metric in the table and want to create another copy or you want to make use Order By for the table.
Ex:-
Source:
Load * Inline
[
Regions,Customers,Sales
a,C1,45863
b,C2,2568
c,C3,2587
d,C3,2582
];
Load
Regions,Customers as CustomerName,Sum( Sales ) as SalAmt
Resident Source
Group By Regions,Customers;
Regards
Anand
Hi,
If you want to use Group by clause, Order by clause, Or any transformation u r going to do you can use resident load.
Deriving new fields,
adding new fields
these kind of things also u can do using resident.
IF you already load table and if same type of table contents you want in other table then you can use resident
tables.
Vikas
resident load is nothing but loading the data from previously loaded table .
u have 100 fields in one table . u want only 20 fields remaining 80 in not required for that scenario .
then u will go with resident load to load only 20 fields .
here u can do some transformations also...
if we want any additional fields/calculated fields a part from the fields from the table loaded, we can achieve through resident table:
Syntax:
ABC:
LOAD
A,
B
From Table_1;
NoConcatenate
Main_Table:
Load *,
(A+B) as Field_1,
Resident ABC;
Drop Table ABC;
As per the above systax.
First table ABC will be loaded with fields A & B.
Then one more resident table(Main_Table) will be created where noconcatenate with additional field(Field_1)
Note: In the resident table if if are doing noconcatenate and loading all the field then we need to drop the main table
Madhu,
Resident Load:
Example:
Employees:
Select Empname,
HireDate,
Salary,
Incentives
From Employee;
Load Empname,
Month(HireDate),
Salary + Incentives as ‘GrossSalary’
Resident Employees;
Thanks,
AS
Hi,
Here are few new examples
1. If want new aggregated field in the new table then we use resident load
Source:
Load * Inline
[
Regions,Customers,Sales
a,C1,45863
b,C2,2568
c,C3,2587
d,C3,2582
];
Load
Regions,Customers as CustomerName,Sum( Sales ) as SalAmt
Resident Source
Group By Regions,Customers;
2. If want to create another copy of the same table then we use the resident load
Source:
Load * Inline
[
Regions,Customers,Sales
a,C1,45863
b,C2,2568
c,C3,2587
d,C3,2582
];
Noconcatenate //this key word is used
Load
Regions,Customers as CustomerName,Sales as SalAmt
Resident Source;
3. Need to order the table according to the fields then we use
Source:
Load * Inline
[
Regions,Customers,Sales
a,C1,45863
b,C2,2568
c,C3,2587
d,C3,2582
];
Noconcatenate //this key word is used
Load
Regions,Customers as CustomerName,Sales as SalAmt
Resident Source
Order By Regions,Customers;
Drop Table Source;
Hope this helps
Anand