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

Add test to check data and index types compatibility #14493

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bziobrowski
Copy link
Contributor

PR adds integration test (disabled by default) that checks compatibility between combinations of:

  • data type - INT, LONG, FLOAT, DOUBLE, BIG_DECIMAL, BOOLEAN, TIMESTAMP, STRING, JSON, BYTES, MAP (all variants)
  • cardinality - single value, multiple values
  • encoding - raw or dictionary
  • index types - timestamp, bloom, fst, geo, inverted, json, native_text, text, range, vector
    and reports the outcome .

@bziobrowski bziobrowski changed the title Add test to check data type/cardinality/encoding compatibility with i… Add test to check data and index types compatibility Nov 19, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.53%. Comparing base (59551e4) to head (d5f0d65).
Report is 1358 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (59551e4) and HEAD (d5f0d65). Click for more details.

HEAD has 44 uploads less than BASE
Flag BASE (59551e4) HEAD (d5f0d65)
integration 7 0
integration2 3 0
temurin 12 3
java-21 7 2
skip-bytebuffers-true 3 1
skip-bytebuffers-false 7 2
unittests 5 3
java-11 5 1
unittests2 3 0
integration1 2 0
custom-integration1 2 0
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14493      +/-   ##
============================================
- Coverage     61.75%   55.53%   -6.22%     
- Complexity      207      790     +583     
============================================
  Files          2436     2100     -336     
  Lines        133233   110662   -22571     
  Branches      20636    17582    -3054     
============================================
- Hits          82274    61458   -20816     
+ Misses        44911    44316     -595     
+ Partials       6048     4888    -1160     
Flag Coverage Δ
custom-integration1 ?
integration ?
integration1 ?
integration2 ?
java-11 55.47% <ø> (-6.24%) ⬇️
java-21 55.39% <ø> (-6.23%) ⬇️
skip-bytebuffers-false 55.52% <ø> (-6.23%) ⬇️
skip-bytebuffers-true 55.34% <ø> (+27.62%) ⬆️
temurin 55.53% <ø> (-6.22%) ⬇️
unittests 55.53% <ø> (-6.22%) ⬇️
unittests1 55.53% <ø> (+8.64%) ⬆️
unittests2 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@npawar
Copy link
Contributor

npawar commented Nov 21, 2024

Why disable by default? this would be a good thing to have running to catch combination regressions?

@bziobrowski
Copy link
Contributor Author

It is rather slow when reload fails in the background, there's no feedback and test waits 5 seconds before marking test case as failed.

@Jackie-Jiang
Copy link
Contributor

Nice! This can give us big confidence!
How long does it take to run the test? Both in your local environment and in Github Actions?

Comment on lines +191 to +203
if ("json".equals(indexType) && ((field.getDataType() != DataType.STRING && field.getDataType() != DataType.JSON)
|| !field.isSingleValueField())) {
throw new RuntimeException(
"JSON index can only be applied to single value column of STRING or JSON data type!");
}

if ("vector".equals(indexType) && (field.getDataType() != DataType.FLOAT || field.isSingleValueField())) {
throw new RuntimeException("VECTOR index can only be applied to Float Array columns");
}

if (("text".equals(indexType) || "native_text".equals(indexType)) && field.getDataType() != DataType.STRING) {
throw new RuntimeException("Text index is currently only supported on STRING columns");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this. What does this failure means? If we want to skip these cases we can either:

  1. Preferred option: Filter them out in fieldsAndIndexTypes
  2. Alternatively: We can throw SkipException, which makes TestNG to skip the test.

...
} */
// no params
indexes.put("bloom", new ObjectNode(JsonNodeFactory.instance));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
indexes.put("bloom", new ObjectNode(JsonNodeFactory.instance));
indexes.put("bloom", JsonUtils.newObjectNode());

Comment on lines +268 to +271
ObjectNode resolutions = new ObjectNode(JsonNodeFactory.instance);
ArrayNode res = new ArrayNode(JsonNodeFactory.instance);
res.add(13).add(5).add(6);
resolutions.put("resolutions", res);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ObjectNode resolutions = new ObjectNode(JsonNodeFactory.instance);
ArrayNode res = new ArrayNode(JsonNodeFactory.instance);
res.add(13).add(5).add(6);
resolutions.put("resolutions", res);
ObjectNode resolutions = JsonUtils.stringToJsonNode("{\"resolutions\": [13, 5, 6]}");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants