Skip to content

Conversation

@bugmakerrrrrr
Copy link
Contributor

Description

#3001

Related Issues

Resolves #3001

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: panguixin <panguixin@bytedance.com>
Copy link
Collaborator

@penghuo penghuo left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution.

One questions, does the change in OpenSearchExprValueFactory.java related to the issue?

Comment on lines +347 to +348
} else if (((OpenSearchDataType) type).getExprType().equals(ARRAY) == false
&& supportArrays == false) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the change? could you elaborate more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the type must be OpenSearchDataType after my change, please correct me if I'm wrong

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is not required, the change improvment the json parse behaviour to support read int value from [int, string] value.

"SELECT typeof(double_number),typeof(long_number), typeof(integer_number),"
+ " typeof(byte_number), typeof(short_number),typeof(float_number),"
+ " typeof(half_float_number), typeof(scaled_float_number) from %s;",
+ " typeof(half_float_number), typeof(scaled_float_number) from %s limit 1;",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why add limit 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above

// ExpressionAnalyzer::isTypeNotSupported
// + ", typeof(nested_value)"
+ " from %s;",
+ " from %s limit 1;",
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

executeQuery(
String.format(
"source=%s | eval `%s` = %s | fields `%s`",
"source=%s | head 1 | eval `%s` = %s | fields `%s`",
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is current result if remove head 1? is it breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I add more rows in TEST_INDEX_DATATYPE_NONNUMERIC index, head 1 to avoid change the test.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the return result order is not guaranteed, why not add another test dataset?

@bugmakerrrrrr
Copy link
Contributor Author

One questions, does the change in OpenSearchExprValueFactory.java related to the issue?

Yes, we need to parse the value in array according to the type of field, not the type of content

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@RyanL1997
Copy link
Collaborator

Hi @bugmakerrrrrr , do we still need this change?

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.

[BUG] Enhance OS value parsing

3 participants