C client query 900+ bin but only return 214 bins?


We use Aerospike CE 3.9.1 and C client 4.0.7.

When I query several records which have more than 3000 bins, and I select 900+ bins from these records. I set n more than 900. bool as_query_select_init ( as_query * query, uint16_t n ) And then I invoke query foreach API aerospike_query_foreach but in the callback data, only have 214 bins’ data, is there any limitation for selected bin numbers?


But select the record with all bins rather than identify the detailed bins, it works properly, if I select the detailed bins which is the subset of all the bins, and if the selected more than 900 bins, only return 214 bins.


The server’s query wire protocol only allows 1 byte for the number of bin names. Therefore, the max number of bin names that can be specified is 255.


Thanks, Brain, is there any document about the query wire protocol? And How can I walk around this issue? I want to select 900 bins out of 3K bins in one record.


In other word, how aql walk around this issue ? Or aql only support select 255 bins?


There is no way around this. You can get all bins by not specifiy any bins. If you specify bins, you are limited to 255 bins.

This only wire protocol doc I can find is below, but it doesn’t mention query:



Thanks Brian, My solution in my application is

  1. Divide bins wanted into several parts, each parts have 255 bins, then polling query all parts, return the result.
  2. Get all bins not specify any one, then filter out the subset I wanted. Is that okay?


can you use a map type and group 3K bins in a smaller subset and use map key-value pairs as "bins" btw, you can build si on map keys