DUPLIATE INDEX Build fails
Please help me understand the difference on why it fails on method 1
"message": "2305: The index record contains fields with no mappings - cannot build an index on it",
"
- Code: Select all
Rec := RECORD
UNSIGNED1 id;
STRING10 col1;
END;
ds1:= DATASET([{1,'a'}],Rec);
/* Method 1 - NOT WORKING */
//idx1:= BUILD(ds1,{ds1.id},{ds1},'~thor::test::file1::202007284_idx',OVERWRITE);
//idx1;
//idx2:= INDEX(ds1,{UNSIGNED1 id,STRING10 col1},rec,'~thor::test::file1::202007284_idx');
//idx2;
//newidx := INDEX(idx2,'~thor::test::file1::202007285_idx_new'); //DUPLICATE INDEX DEFN
//BUILDINDEX(newidx ); //FAILS
/* Method 2 WORKING */
idx_1:= INDEX(ds1,{id},{ds1},'~thor::test::file1::202007281_idx_1');
//build(idx_1);
newidx_1:= INDEX(idx_1,'~thor::test::file1::202007281_idx_2'); //DUPLICATE INDEX DEFN
BUILDINDEX(newidx_1); //WORKS
- BalajiTS
- Posts: 4
- Joined: Fri May 29, 2020 2:50 am
BalajiTS,
The first way doesn't work because the structure you defined for the INDEX does not match the structure you specified in your BUILD.
To duplicate the result of your BUILD you need to define it like this:
HTH,
Richard
The first way doesn't work because the structure you defined for the INDEX does not match the structure you specified in your BUILD.
- Code: Select all
idx1:= BUILD(ds1,{ds1.id},{ds1},'~RTtest::file1::202007284_idx',OVERWRITE);
idx1;
- Code: Select all
idx2:= INDEX(ds1,{UNSIGNED1 id,STRING10 col1},rec,'~RTtest::file1::202007284_idx');
idx2;
To duplicate the result of your BUILD you need to define it like this:
- Code: Select all
idx2:= INDEX(ds1,{UNSIGNED1 id},{STRING10 col1},'~RTtest::file1::202007284_idx');
idx2;
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1619
- Joined: Wed Oct 26, 2011 7:40 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest