curl -X POST "http://localhost:8093/query/service" -u Administrator:password -H "Content-Type: application/json" -d '{ "statement": "prepare test01 AS SELECT META(lb).id AS `key`, { \"type\":\"sameday\", \"src_sys\":\"testrc\", \"acct_nb\":lb.dp_num, \"rtg_nb\":LTRIM(lb.dp_rt, \"0\"), \"acct_rtg_nb\":CONCAT2(\"|\",lb.dp_num,LTRIM(lb.dp_rt,\"0\"))} AS `value` FROM bucket01.scp02.`c0ll5` lb INNER JOIN bucket01.scp01.`coll1` bnk ON LTRIM(lb.dp_rt,\"0\") = bnk.rtnum INNER JOIN bucket01.scp01.`coll2` trancd_ref ON UPPER(trancd_ref.TpsNm)=\"testsrc\" INNER JOIN `bucket01`.`scp01`.`coll3` dtl_ref ON trancd_ref.TxCd = dtl_ref.TranCode INNER JOIN bucket01.scp01.`coll4` cta_ref ON lb.dp_num = cta_ref.AccountNumber AND LTRIM(lb.dp_rt,\"0\") = cta_ref.rtnum AND UPPER(cta_ref.Status) = \"A\" WHERE meta(lb).id = $meta_id"}'id"}'
{
"requestID": "1b8a2dde-b7f0-4acb-b3cf-7fbc75c8a497",
"signature": "json",
"results": [
{"encoded_plan":"H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA=","featureControls":76,"indexApiVersion":4,"indexScanKeyspaces":{"default:bucket01.scp01.coll1":false,"default:bucket01.scp01.coll2":false,"default:bucket01.scp01.coll3":false,"default:bucket01.scp01.coll4":false,"default:bucket01.scp02.c0ll5":false},"name":"[127.0.0.1:8091]test01","namespace":"default","operator":{"#operator":"Authorize","privileges":{"List":[{"Priv":7,"Props":0,"Target":"default:bucket01.scp02.c0ll5"},{"Priv":39,"Props":0,"Target":"default:bucket01.scp02.c0ll5"},{"Priv":7,"Props":0,"Target":"default:bucket01.scp01.coll1"},{"Priv":39,"Props":0,"Target":"default:bucket01.scp01.coll1"},{"Priv":7,"Props":0,"Target":"default:bucket01.scp01.coll2"},{"Priv":39,"Props":0,"Target":"default:bucket01.scp01.coll2"},{"Priv":7,"Props":0,"Target":"default:bucket01.scp01.coll3"},{"Priv":39,"Props":0,"Target":"default:bucket01.scp01.coll3"},{"Priv":7,"Props":0,"Target":"default:bucket01.scp01.coll4"},{"Priv":39,"Props":0,"Target":"default:bucket01.scp01.coll4"},{"Priv":39,"Props":0,"Target":"`default`:`bucket01`.`scp01`.`coll4`"},{"Priv":39,"Props":0,"Target":"`default`:`bucket01`.`scp01`.`coll3`"},{"Priv":39,"Props":0,"Target":"`default`:`bucket01`.`scp01`.`coll1`"},{"Priv":39,"Props":0,"Target":"`default`:`bucket01`.`scp02`.`c0ll5`"},{"Priv":39,"Props":0,"Target":"`default`:`bucket01`.`scp01`.`coll2`"}]},"~child":{"#operator":"Sequence","~children":[{"#operator":"Sequence","~children":[{"#operator":"PrimaryScan3","as":"cta_ref","bucket":"bucket01","index":"#sequentialscan","index_projection":{"primary_key":true},"keyspace":"coll4","namespace":"default","scope":"scp01","using":"sequentialscan"},{"#operator":"Fetch","as":"cta_ref","bucket":"bucket01","early_projection":["AccountNumber","Status","rtnum"],"keyspace":"coll4","namespace":"default","scope":"scp01"},{"#operator":"Parallel","maxParallelism":1,"~child":{"#operator":"Sequence","~children":[{"#operator":"Filter","alias":"cta_ref","condition":"(upper((`cta_ref`.`Status`)) = \"A\")"}]}},{"#operator":"HashJoin","build_aliases":["lb","bnk","trancd_ref","dtl_ref"],"build_exprs":["(`lb`.`dp_num`)","ltrim((`lb`.`dp_rt`), \"0\")"],"on_clause":"((((`lb`.`dp_num`) = (`cta_ref`.`AccountNumber`)) and (ltrim((`lb`.`dp_rt`), \"0\") = (`cta_ref`.`rtnum`))) and (upper((`cta_ref`.`Status`)) = \"A\"))","probe_exprs":["(`cta_ref`.`AccountNumber`)","(`cta_ref`.`rtnum`)"],"~child":{"#operator":"Sequence","~children":[{"#operator":"PrimaryScan3","as":"dtl_ref","bucket":"bucket01","index":"#sequentialscan","index_projection":{"primary_key":true},"keyspace":"coll3","namespace":"default","scope":"scp01","using":"sequentialscan"},{"#operator":"Fetch","as":"dtl_ref","bucket":"bucket01","early_projection":["TranCode"],"keyspace":"coll3","namespace":"default","scope":"scp01"},{"#operator":"HashJoin","build_aliases":["lb","bnk","trancd_ref"],"build_exprs":["(`trancd_ref`.`TxCd`)"],"on_clause":"((`trancd_ref`.`TxCd`) = (`dtl_ref`.`TranCode`))","probe_exprs":["(`dtl_ref`.`TranCode`)"],"~child":{"#operator":"Sequence","~children":[{"#operator":"PrimaryScan3","as":"bnk","bucket":"bucket01","index":"#sequentialscan","index_projection":{"primary_key":true},"keyspace":"coll1","namespace":"default","scope":"scp01","using":"sequentialscan"},{"#operator":"Fetch","as":"bnk","bucket":"bucket01","early_projection":["rtnum"],"keyspace":"coll1","namespace":"default","scope":"scp01"},{"#operator":"HashJoin","build_aliases":["lb"],"build_exprs":["ltrim((`lb`.`dp_rt`), \"0\")"],"on_clause":"(ltrim((`lb`.`dp_rt`), \"0\") = (`bnk`.`rtnum`))","probe_exprs":["(`bnk`.`rtnum`)"],"~child":{"#operator":"Sequence","~children":[{"#operator":"IndexScan3","as":"lb","bucket":"bucket01","index":"#sequentialscan","index_id":"#sequentialscan","keyspace":"c0ll5","namespace":"default","scope":"scp02","spans":[{"exact":true,"range":[{"high":"$meta_id","inclusion":3,"low":"$meta_id"}]}],"using":"sequentialscan"},{"#operator":"Fetch","as":"lb","bucket":"bucket01","early_projection":["dp_num","dp_rt"],"keyspace":"c0ll5","namespace":"default","scope":"scp02"},{"#operator":"Parallel","~child":{"#operator":"Sequence","~children":[{"#operator":"Filter","alias":"lb","condition":"((meta(`lb`).`id`) = $meta_id)"}]}}]}},{"#operator":"Parallel","maxParallelism":1,"~child":{"#operator":"Sequence","~children":[{"#operator":"NestedLoopJoin","alias":"trancd_ref","on_clause":"(upper((`trancd_ref`.`TpsNm`)) = \"testsrc\")","~child":{"#operator":"Sequence","~children":[{"#operator":"PrimaryScan3","as":"trancd_ref","bucket":"bucket01","index":"#sequentialscan","index_projection":{"primary_key":true},"keyspace":"coll2","namespace":"default","scope":"scp01","using":"sequentialscan"},{"#operator":"Fetch","as":"trancd_ref","bucket":"bucket01","cache_result":true,"early_projection":["TpsNm","TxCd"],"keyspace":"coll2","namespace":"default","nested_loop":true,"scope":"scp01"},{"#operator":"Parallel","maxParallelism":1,"~child":{"#operator":"Sequence","~children":[{"#operator":"Filter","alias":"trancd_ref","condition":"(upper((`trancd_ref`.`TpsNm`)) = \"testsrc\")"}]}}]}}]}}]}}]}},{"#operator":"Parallel","maxParallelism":1,"~child":{"#operator":"Sequence","~children":[{"#operator":"InitialProject","discard_original":true,"preserve_order":true,"result_terms":[{"as":"key","expr":"(meta(`lb`).`id`)"},{"as":"value","expr":"{\"acct_nb\": (`lb`.`dp_num`), \"acct_rtg_nb\": concat2(\"|\", (`lb`.`dp_num`), ltrim((`lb`.`dp_rt`), \"0\")), \"rtg_nb\": ltrim((`lb`.`dp_rt`), \"0\"), \"src_sys\": \"testrc\", \"type\": \"sameday\"}"}]}]}}]},{"#operator":"Stream","serializable":true}]}},"queryContext":"","reqType":"SELECT","signature":{"key":"json","value":"object"},"text":"prepare test01 AS SELECT META(lb).id AS `key`, { \"type\":\"sameday\", \"src_sys\":\"testrc\", \"acct_nb\":lb.dp_num, \"rtg_nb\":LTRIM(lb.dp_rt, \"0\"), \"acct_rtg_nb\":CONCAT2(\"|\",lb.dp_num,LTRIM(lb.dp_rt,\"0\"))} AS `value` FROM bucket01.scp02.`c0ll5` lb INNER JOIN bucket01.scp01.`coll1` bnk ON LTRIM(lb.dp_rt,\"0\") = bnk.rtnum INNER JOIN bucket01.scp01.`coll2` trancd_ref ON UPPER(trancd_ref.TpsNm)=\"testsrc\" INNER JOIN `bucket01`.`scp01`.`coll3` dtl_ref ON trancd_ref.TxCd = dtl_ref.TranCode INNER JOIN bucket01.scp01.`coll4` cta_ref ON lb.dp_num = cta_ref.AccountNumber AND LTRIM(lb.dp_rt,\"0\") = cta_ref.rtnum AND UPPER(cta_ref.Status) = \"A\" WHERE meta(lb).id = $meta_id","useCBO":true}
],
"status": "success",
"metrics": {"elapsedTime": "54.211274ms","executionTime": "54.115151ms","resultCount": 1,"resultSize": 6379,"serviceLoad": 3}
}
It works for me