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

Support ANN sorting for tables #1620

Merged
merged 25 commits into from
Nov 1, 2024
Merged

Support ANN sorting for tables #1620

merged 25 commits into from
Nov 1, 2024

Conversation

amorton
Copy link
Contributor

@amorton amorton commented Oct 30, 2024

What this PR does:

Currently handling sort as a CQL order by only works with vectors as float array

see also #1618 and #1628
Which issue(s) this PR fixes:
Fixes #1559

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

amorton added 20 commits October 9, 2024 15:56
Changes the warnings associated commands to use the new ApiExcpetions,
and `warnings` in the return status now returns a list of error object V2.

To do that needed to improve the way CommandResult was built, so it always
had a status map so the CommandProcessor could append a warning. To do that
expanded the CommandResultBuilder added for the OperationAttempts, removed
the many overloads used for CommandResult, and updated all creation of the
CommandResult to use the builder.

See also #1518 to continue this
…cResponses

Missed adding errors to the CommandResult builder for
per document responses in InsertOperationPage
- change CommandErrorV2 property to match bean style
- change CreateKeyspaceIntegrationTest to get new response warning
and made both create and drop tests check the names of the commands
in the message
- our schema cache was not invalidating when a table was changed, so
we would always give out missing index errors rather than errors when
index was there but did not support the operation

- updated integration tests for the full error in the warning, and
made them check the id for the warning

- big fix, we were not turning on allow filtering when doing a
comparison query for some data types on indexed columns
@amorton amorton marked this pull request as ready for review October 31, 2024 21:52
@amorton amorton requested a review from a team as a code owner October 31, 2024 21:52
@amorton amorton changed the title WIP Support ANN sorting for tables Support ANN sorting for tables Oct 31, 2024
return sortExpressions == null || sortExpressions.isEmpty();
}

public List<SortExpression> tableVectorSorts() {
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, tableVectorSorts means vector sort on a vector table column. and table column can't be $vector and $vectorize?

} else if (DataTypes.TINYINT.equals(type)) {
return JsonNodeFactory.instance.numberNode(Byte.valueOf("1"));
} else if (DataTypes.UUID.equals(type)) {
return JsonNodeFactory.instance.textNode("550e8400-e29b-41d4-a716-446655440000");
} else if (DataTypes.VARINT.equals(type)) {
return JsonNodeFactory.instance.numberNode(BigDecimal.valueOf(1L));
} else if (type.getClass().getName().startsWith(DefaultVectorType.VECTOR_CLASS_NAME)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not used, correct?

@amorton amorton merged commit a9e7484 into main Nov 1, 2024
3 checks passed
@amorton amorton deleted the ajm/ann-sort-tables branch November 1, 2024 21:47
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.

Support sorting by vector for API Tables
2 participants