Details
-
Bug
-
Status: Resolved
-
Not specified
-
Resolution: Fixed
-
None
-
None
-
None
Description
when filter clause includes a keyed and a non-keyed field, and an index fetch is performed, the non-keyed field is being used in the fetch condition causing an error.
for example:
select * from tutorial::rp::tutorialperson where zip = '54530' and middlename = 'N'
Index file '~tutorial::rp::peoplebyzipindex' is keyed by zip, but not by middlename.
Resulting ECL:
import std;
Tbl1RecDef := RECORD string15 firstname; string25 lastname; string15 middlename; string5 zip; string42 street; string20 city; string2 state; unsigned8 fpos
; END;
Tbl1DS := DATASET('~tutorial::rp::tutorialperson', Tbl1RecDef,FLAT);
Idx := INDEX(Tbl1DS,
{zip},
{ fpos },'~tutorial::rp::peoplebyzipindex');
IdxDS := FETCH(Tbl1DS, Idx( ( zip = '54530' )), RIGHT.fpos);
SelectStruct := RECORD
string15 middlename := IdxDS.middlename;
string5 zip := IdxDS.zip;
string20 city := IdxDS.city;
string2 state := IdxDS.state;
string15 firstname := IdxDS.firstname;
string42 street := IdxDS.street;
string25 lastname := IdxDS.lastname;
END;
IdxDSTable := TABLE(IdxDS, SelectStruct );
OUTPUT(CHOOSEN(IdxDSTable,ALL),NAMED('JDBCSelectQueryResult'));
Total elapsed http request/response time in milliseconds: 189
Parsing results...
java.sql.SQLException: java.lang.Exception: HPCCJDBC: Error in response: ' Unknown identifier "middlename"'