ydb-platform / yoj-project

YDB ORM for Java (YOJ) is a lightweight ORM for immutable entities. It has native support for YDB and is battle-tested.
Apache License 2.0
13 stars 12 forks source link

YdbSchemaCompatibilityChecker fails on new table in unexisted directory #45

Closed lavrukov closed 9 months ago

lavrukov commented 9 months ago

I add to project new table with annotation @Table(name = "newDir/MyTable"). It is the first table in this dir and YdbRepository can create it because it have a code for create dirs. But YdbSchemaCompatibilityChecker got this

 tech.ydb.core.UnexpectedResultException: Cannot get value, code: SCHEME_ERROR, issues: [Path not found (S_ERROR)]
        at tech.ydb.core.Result$Fail.getValue(Result.java:128)
        at tech.ydb.yoj.repository.ydb.client.YdbSchemaOperations.listDirectory(YdbSchemaOperations.java:362)
        at tech.ydb.yoj.repository.ydb.client.YdbSchemaOperations.tables(YdbSchemaOperations.java:243)
        at tech.ydb.yoj.repository.ydb.client.YdbSchemaOperations.tableStream(YdbSchemaOperations.java:237)
        at tech.ydb.yoj.repository.ydb.client.YdbSchemaOperations.getTables(YdbSchemaOperations.java:227)
        at tech.ydb.yoj.repository.ydb.client.YdbSchemaOperations.getTables(YdbSchemaOperations.java:222)
        at tech.ydb.yoj.repository.ydb.compatibility.YdbSchemaCompatibilityChecker.lambda$run$0(YdbSchemaCompatibilityChecker.java:85)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)