Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't return one tuple/number indexed table without table wrapper #79

Open
ArtDu opened this issue Jan 11, 2022 · 0 comments
Open

Can't return one tuple/number indexed table without table wrapper #79

ArtDu opened this issue Jan 11, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ArtDu
Copy link
Contributor

ArtDu commented Jan 11, 2022

Right now we don't get to return a single array without additional wrapping.

@Test
    public void test_array_shouldCalledSuccessfully_byDomainType_withTuple() {
        //given
        SimpleArray expected = SimpleArray.builder()
                .testId(null)
                .testBoolean(true)
                .testString("abc")
                .testInteger(123)
                .testDouble(1.23)
                .build();

        //when
        SimpleArray actual = repositoryByDomainTypeWithTuple.getSimpleArray();

        //then
        assertEquals(expected, actual);
    }
public interface ArrayReturnRepositoryByDomainType extends TarantoolRepository<SimpleArray, Integer> {
    @Tuple("test_simple_object")
    @Query(function = "returning_simple_array")
    SimpleArray getSimpleArray();
}
function returning_simple_array()
    return { nil, true, "abc", 123, 1.23 }
end

We will get an error:

org.springframework.dao.InvalidDataAccessResourceUsageException: Failed to convert MessagePack value of type NIL to tuple; nested exception is io.tarantool.driver.exceptions.TarantoolTupleConversionException: Failed to convert MessagePack value of type NIL to tuple

But if you wrap it in an additional table, then everything is ok.

function returning_simple_array()
    return {{ nil, true, "abc", 123, 1.23 }}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants