Skip to content

IndexMapReduce returning empty list  #709

@lukasz-gosiewski

Description

@lukasz-gosiewski

Context

When using IndexMapReduce in Java client Riak is returning an empty list instead of proper results, despite that everything is working fine in Python and over HTTP.

Expected Behavior

Riak should return list of all objects containing specified index.

Actual Behavior

Riak is returning empty list instead

Steps to Reproduce

  1. Create bucket, name it and insert data into int
  2. Index this data with few indexes matching searched one
  3. Execute below code with few corrections to match your env
  4. Empty list arrives!

Your Environment

  • [ 2.1.1] Riak Java Client version
  • [ 1.8] Java version
  • [ArchLinux on client side, Ubuntu on server side ] Operating System / Distribution & Version
  • [ RiakClient.execute()] What methods were being executed during the error
MapReduce mapReduce = new IndexMapReduce.Builder()
                .withNamespace(new Namespace(transactionsBucketName))
                .withIndex("addr_out_" + BaseEncoding.base32().encode(address.getBytes()) + "_bin")
                .withRange(BinaryValue.unsafeCreate("0".getBytes()), BinaryValue.unsafeCreate("z".getBytes()))
                .withMapPhase(Function.newNamedJsFunction("Riak.mapValues"))
                .build();

        IndexMapReduce.Response response;

        try {
            response = riakClient.execute(mapReduce);
        } catch (ExecutionException | InterruptedException e) {
            log.error(e);
            throw new DataFetchException(e);
        }

        log.info(response);```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions