Open iiiLiQuiDiii opened 8 years ago
A quick solution to obtaining tuples with the partial key "CD" is to iterate over all the possible instances of A. Let's say A can be one of {1, 5, 6} , we can query for "1-C-D" , "5-C-D". "6-C-D" and merge the results. If ||A|| is big it may be necessary to rearrange the table key.
Description
If we have a table with the following columns "A", "B", "C", "D" where the key is ACD, then the only valid partial keys are "A" , "AC" and "ACD". These are sequences and must always start from A (CA is invalid ), also there cannot be holes ( "AD" is invalid ).
Is there a way to have partial keys as proper subsets instead of sequences? If not, are there plans for implementing it?
Describe How to Reproduce
deploy github.com/hyperledger/fabric/bddtests/chaincode/go/table
{"Function":"insertRowTableTwo", "Args": ["1", "2", "3", "4" ]}'
{"Function": "getRowsTableTwo", "Args":["1"] }' returns a result {"Function": "getRowsTableTwo", "Args":["3"] }' returns null {"Function": "getRowsTableTwo", "Args":["4"] }' returns null
"Function": "getRowsTableTwo", "Args":["1","3"] } returns a result "Function": "getRowsTableTwo", "Args":["3","1"] } returns null "Function": "getRowsTableTwo", "Args":["3","4"] } returns null "Function": "getRowsTableTwo", "Args":["1","4"] } returns null
"Function": "getRowsTableTwo", "Args":["1","3","4"] } returns a result