Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am getting error for below script:
--> script
Table1:
SQL SELECT
FIELD_A,
FIELD_B,
FIELD_C
FROM .. ;
Table2:
LOAD FIELD_A,
Subfield(FIELD_C, '#', 1) as temp1;
SubField(FIELD_C, '#', 2) as temp2;
LOAD FIELD_A,
Subfield(FIELD_C, '$') as temp3;
LOAD FIELD_A, FIELD_C
Resident Table1;
-->error
Field not found - <FIELD_C>
LOAD FIELD_A, FIELD_C
Resident Table1;
Can someone help me with this?
Thank you
Kinjal
Try this
Table2:
LOAD *,
Subfield(FIELD_C, '#', 1) as temp1;
SubField(FIELD_C, '#', 2) as temp2;
//LOAD FIELD_A,
Subfield(FIELD_C, '$', 1) as temp3;
LOAD trace_id,
SubField(metainfo, '$') as Properties;
//LOAD FIELD_A, FIELD_C
Resident Table1;
If you look - You are doing Preceding load concept. So, I may look this way where you stuck
Table2:
LOAD FIELD_A,
Subfield(FIELD_C, '#', 1) as temp1;
SubField(FIELD_C, '#', 2) as temp2;
LOAD FIELD_A, FIELD_C
Subfield(FIELD_C, '$', 1) as temp3;
LOAD trace_id,
SubField(metainfo, '$') as Properties; // Where is the FIELD_C comes from? If you add like in RED, Your problem solvs
LOAD FIELD_A, FIELD_C
Resident Table1;
ur preceding load throw error.. so ...insted of using preceding load 3 time you can write this way..
Table1:
SQL SELECT
FIELD_A,
FIELD_B,
FIELD_C
FROM .. ;
Table2:
LOAD FIELD_A,
Subfield(FIELD_C, '-', -1) as temp1,
SubField(FIELD_C, '-', -2) as temp2,
Subfield(FIELD_C, '-', 1) as temp3;
LOAD FIELD_A, FIELD_C
Resident Table1;