Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please look at the script below.
In this case I will not get any data.
Can't understand logic.
I use resident and it have to bring all data from Table1 to TableTotal.
Table1:
Load * INLINE [
Name, Data
First, 1
Second, 2
Third, 3
];
LEFT JOIN(Table1)
Table2:
LOAD * INLINE [
Value
1];
TableTotal:
LOAD *
Resident Table1;
Drop Table Table1;
You need to add NoConcatenate necause Table1 and TableTotal have the same field names and will auto-concatenate. To avoid auto-concatenate we add NoConcateante.
Table1:
Load * INLINE [
Name, Data
First, 1
Second, 2
Third, 3
];
LEFT JOIN(Table1)
Table2:
LOAD * INLINE [
Value
1];
TableTotal:
NoConcatenate
LOAD *
Resident Table1;
Drop Table Table1;
You need to add NoConcatenate necause Table1 and TableTotal have the same field names and will auto-concatenate. To avoid auto-concatenate we add NoConcateante.
Table1:
Load * INLINE [
Name, Data
First, 1
Second, 2
Third, 3
];
LEFT JOIN(Table1)
Table2:
LOAD * INLINE [
Value
1];
TableTotal:
NoConcatenate
LOAD *
Resident Table1;
Drop Table Table1;
Thanx Sunny.
You are right.
But one more question plese.
I need also do
FOR EACH vFile in FileList
with the same code above.
All files are the same with different data.
As result I need one table with all data from files.
If I use Noconcatenate I will receive a lot of tables.
Do you know how to solve it?
Add a flag when you create your new table (for example 1 as Dummy). This will help you avoid the initial auto concatenate. Later you can drop this Dummy field
Table1:
Load * INLINE [
Name, Data
First, 1
Second, 2
Third, 3
];
LEFT JOIN(Table1)
Table2:
LOAD * INLINE [
Value
1];
TableTotal:
LOAD *,
1 as Dummy
Resident Table1;
Drop Table Table1;
DROP Field Dummy;
This way create few tables.
As I see after first cycle TableTotal will have different structure to Table1
Try to use
Table1:
Load * INLINE [
Name, Data
First, 1
Second, 2
Third, 3
];
LEFT JOIN(Table1)
Table2:
LOAD * INLINE [
Value
1];
Concatenate
TableTotal:
LOAD *,
1 as Dummy
Resident Table1;
Drop Table Table1;
DROP Field Dummy;
Get error "Field not found. Did not find field Dummy from the DROP FIELD statement"
You wrote true.
Only need add Drop field after "next"
It means when cycle is finished then drop temporary field.
Thanx a lot!