Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Yevhenii_Senko
Contributor III
Contributor III

No data after resident

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;

1 Solution

Accepted Solutions
sunny_talwar

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;

View solution in original post

5 Replies
sunny_talwar

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;

Yevhenii_Senko
Contributor III
Contributor III
Author

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?

sunny_talwar

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;

Yevhenii_Senko
Contributor III
Contributor III
Author

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"

Yevhenii_Senko
Contributor III
Contributor III
Author

You wrote true.

Only need add Drop field after "next"

It means when cycle is finished then drop temporary field.

Thanx a lot!