Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a table - which have a huge record size
after i load the table, i would like to add some extra columns to this
example :
tableA:
Load * form
[tableA.qvd]
(qvd);
tableB:
Load * ,
year(businessDate) as year ,
month(businessDate) as year ,
resident
tableA;
drop table tableA;
It will create two tables .Is there any function just for add extra columns to a table ?
There is no need to create two tables if you are adding a few colums. You may follow the following script.
TableA:
LOAD *, expression1 as newfield1, expression2 as newfield2;
LOAD * from TableA.qvd (qvd);
where expression1, expression2 generate values for the newfield1 and newfield2.
If you are adding calendar-related fields to a date-field, you may create a new calendar file linked by the date-field.
but sometime i may need to do something like :
tableA:
Load *,
month(business_date) as month,
applymap('ABC',column,'No data' ) as CustomerID
form
[tableA.qvd]
(qvd);
tableB:
Load * ,
if (CustomerID ='No Date',columnB,CustomerID ) as CustomerID
resident
tableA;
tableC:
Load * ,
CustomerID & month as budgetkey
resident
tableB;
Is there any any function is good for add extra column /modify the content of the table .