Skip to content

Nested joins - #145

Closed
slowcheetahzzz wants to merge 1 commit into
nested_joins_compatibilityfrom
nested_joins
Closed

Nested joins#145
slowcheetahzzz wants to merge 1 commit into
nested_joins_compatibilityfrom
nested_joins

Conversation

@slowcheetahzzz

Copy link
Copy Markdown
Collaborator

No description provided.

@slowcheetahzzz
slowcheetahzzz changed the base branch from master to nested_joins_compatibility August 11, 2026 15:38
Comment thread src/test/java/ru/rt/restream/reindexer/connector/JoinTest.java
Comment thread src/test/java/ru/rt/restream/reindexer/connector/JoinTest.java
Comment thread src/test/java/ru/rt/restream/reindexer/connector/JoinTest.java
db.upsert("roles", role);

Query<Actor> actorQuery = db.query("actors", Actor.class)
.innerJoin(db.query("roles", Role.class), "joinedRoles")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Покрытие позитивных сценариев хорошо бы расширить. Как минимум:

  • комбинации вложенных left/inner
  • позитивный тест-кейс merge + nested joins
  • позитивный тест-кейс на nested join с глубиной вложенности 2+

Comment thread src/test/java/ru/rt/restream/reindexer/connector/JoinTest.java
if (format != QUERY_FORMAT_V2) {
String errorMessage = String.format("QueryResults format version='%d' is not supported", format);
throw new RuntimeException(errorMessage);
buffer.rewind();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут был бросок исключения, и он по смыслу был праввильным


@Override
public boolean supportsNestedJoinQueries() {
return builtin.supportsNestedJoinQueries();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Флаг выглядит избыточным. Если используется QueryFormatV2, то мы гарантированно поддерживаем nested joins

reindexer_string dsn = rx_string(env, path);
reindexer_string vers = rx_string(env, version);
int64_t capabilities = kBindingCapabilityResultsWithShardIDs | kBindingCapabilityComplexRank;
if (queryFormatVersion == QueryFormatV2) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builtin всегда работает по V2, логика лишняя

return parsedVersion[2] >= NESTED_JOIN_QUERIES_MIN_PATCH;
}

private int[] parseVersion(String version) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вся логика с парсингом версии избыточна - у нас уже есть caps, который определяет поддержу nested join

@slowcheetahzzz
slowcheetahzzz deleted the nested_joins branch August 14, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants