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

Java: FT.CREATE #2414

Merged
merged 5 commits into from
Oct 11, 2024
Merged

Java: FT.CREATE #2414

merged 5 commits into from
Oct 11, 2024

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Oct 9, 2024

Issue link

#2428

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Commits will be squashed upon merging.

@Yury-Fridlyand Yury-Fridlyand added the java issues and fixes related to the java client label Oct 9, 2024
@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner October 9, 2024 17:44
Signed-off-by: Yury-Fridlyand <[email protected]>
.github/workflows/java.yml Outdated Show resolved Hide resolved
/** Type of the index dataset. */
public enum IndexType {
/** Data stored in hashes, so field identifiers are field names within the hashes. */
HASH,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
HASH,
HASH("ON HASH"),

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be 2 different args

public static class NumericField implements Field {
@Override
public String[] toArgs() {
return new String[] {FieldType.NUMERIC.toString()};
Copy link
Contributor

Choose a reason for hiding this comment

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

why use an enum here? a String works just as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A recommendation from @prateek-kumar-improving to use constants. Could be helpful when we use it in multiple places

private Optional<Character> separator;
private final boolean caseSensitive;

/** Create a <code>TAG</code> field. */
Copy link
Contributor

Choose a reason for hiding this comment

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

warning here? Should only be used for HASH index types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why? Can't find such thing in docs.

*
* @param caseSensitive Whether to keep the original case.
*/
public TagField(boolean caseSensitive) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning here? Should only be used for HASH index types?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could not find this in the documentation?

Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand changed the base branch from main to release-1.2 October 10, 2024 17:35
Signed-off-by: Yury-Fridlyand <[email protected]>
@NonNull String indexName,
@NonNull FieldInfo[] fields,
@NonNull FTCreateOptions options) {
return create(client, gs(indexName), fields, options);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will accepting String parameter (indexName here) but passing the GlideString version to customCommand() affect the output of the command anyhow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is a binary version of custom command is used. I hope no.

@SneakyThrows
public void check_module_loaded() {
var client =
public static void init() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question: is this approach of creating a single client and share it among all tests preferred over creating a new client for every tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is no preference so far. Do whatever you like in your tests.

Copy link
Contributor

@acarbonetto acarbonetto left a comment

Choose a reason for hiding this comment

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

some small comments - please address before merging

@@ -9,8 +9,10 @@
exports glide.api.models.commands.function;
exports glide.api.models.commands.scan;
exports glide.api.models.commands.stream;
exports glide.api.models.commands.FT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand merged commit bbfce44 into release-1.2 Oct 11, 2024
8 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the java/yuryf-ft-create branch October 11, 2024 18:08
Yury-Fridlyand added a commit that referenced this pull request Oct 11, 2024
Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand mentioned this pull request Oct 11, 2024
Muhammad-awawdi-amazon pushed a commit that referenced this pull request Oct 14, 2024
Signed-off-by: Yury-Fridlyand <[email protected]>
Muhammad-awawdi-amazon pushed a commit to Muhammad-awawdi-amazon/valkey-glide that referenced this pull request Oct 15, 2024
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Muhammad Awawdi <[email protected]>
avifenesh pushed a commit to avifenesh/valkey-glide that referenced this pull request Oct 21, 2024
Signed-off-by: Yury-Fridlyand <[email protected]>
avifenesh pushed a commit to avifenesh/valkey-glide that referenced this pull request Oct 21, 2024
Signed-off-by: Yury-Fridlyand <[email protected]>
Muhammad-awawdi-amazon pushed a commit to Muhammad-awawdi-amazon/valkey-glide that referenced this pull request Oct 22, 2024
Signed-off-by: Yury-Fridlyand <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java issues and fixes related to the java client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants