-
Notifications
You must be signed in to change notification settings - Fork 25k
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
QL: add unsigned_long type support #65145
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
5b2ae44
Add unsigned_long type support to QL
bpintea 56b6e3d
style fixes
bpintea 0b648ae
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea 9eda683
Make JDBC QA tests version aware
bpintea dced577
Disable UL for 7.11 till after merging it in
bpintea 30360f4
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea e2a2363
Refactor UL gating based on version
bpintea ab5eaa0
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea 672df32
Minor clean-ups
bpintea 93ece7c
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea cbcb148
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea 85447c1
Address reivew comments
bpintea 6a8ac44
Merge branch 'master' into feat/unsigned_long
elasticmachine 6801bd5
Remove stale comment
bpintea 9210138
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea c9bfffd
Filter out UL from * expansion. Drop client check
bpintea 2d64608
Revert FieldExtractorTestCase: no float to UL
bpintea 754d026
Address review comments
bpintea 6119fd3
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea d89513c
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea 46a072e
Add 'SHOW COLUMNS' tests
bpintea 0897d8e
Switch UNSIGNED_LONG to NUMERIC xDBC type
bpintea 1b906ec
Update test
bpintea 346b566
Merge branch 'master' into feat/unsigned_long
elasticmachine f99eeec
Style fix
bpintea a8c586b
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea 0799d72
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea f5be346
Merge remote-tracking branch 'upstream/master' into feat/unsigned_long
bpintea 9664e23
License header fix
bpintea 91bd1d6
Merge branch 'master' into feat/unsigned_long
bpintea f8c20db
Update target release.Update test to 4-dig. years
bpintea c1718b5
Merge branch 'master' into feat/unsigned_long
bpintea 9b5bc54
Merge branch 'master' into feat/unsigned_long
bpintea 71e707b
Merge branch 'master' into feat/unsigned_long
bpintea 51a4f84
Add Painless-driven testing
bpintea c6a170c
Merge branch 'master' into feat/unsigned_long
bpintea 38b1450
Merge branch 'master' into feat/unsigned_long
bpintea d398757
Merge branch 'master' into feat/unsigned_long
elasticmachine bbfcd93
Merge branch 'master' into feat/unsigned_long
bpintea 509892c
Extend value extraction as unsigned long
bpintea d03cb1d
Address review comments
bpintea 35149d8
Merge branch 'master' into feat/unsigned_long
bpintea 0943d4b
Remove ShowColumns UL version-dep filtering
bpintea 8ebfad1
Extract mapping reading out of loops
bpintea 64f02f7
Resolve UL fields to unsupported in resolver
bpintea 95d8c02
Merge branch 'master' into feat/unsigned_long
bpintea 67d38aa
Merge branch 'master' into feat/unsigned_long
bpintea 41be569
Merge branch 'master' into feat/unsigned_long
bpintea f6c3a8e
Address review comments
bpintea abda408
Update docs/changelog/65145.yaml
bpintea c14a41f
Merge branch 'master' into feat/unsigned_long
bpintea 5302100
Extract UL to Unsupported map transf. to own class
bpintea fba1d65
Move compat filtering out of the Analyzer
bpintea 80c79d4
Merge branch 'master' into feat/unsigned_long
bpintea 6ce3a1e
Apply review comments. Bump UL intro version
bpintea 4ef30c1
Merge branch 'master' into feat/unsigned_long
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 65145 | ||
summary: Add `unsigned_long` type support | ||
area: Query Languages | ||
type: enhancement | ||
issues: | ||
- 63312 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexCompatibility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.ql.index; | ||
|
||
import org.elasticsearch.Version; | ||
import org.elasticsearch.xpack.ql.type.DataType; | ||
import org.elasticsearch.xpack.ql.type.EsField; | ||
import org.elasticsearch.xpack.ql.type.UnsupportedEsField; | ||
|
||
import java.util.Map; | ||
|
||
import static org.elasticsearch.xpack.ql.index.VersionCompatibilityChecks.isTypeSupportedInVersion; | ||
import static org.elasticsearch.xpack.ql.type.DataTypes.isPrimitive; | ||
import static org.elasticsearch.xpack.ql.type.Types.propagateUnsupportedType; | ||
|
||
public final class IndexCompatibility { | ||
|
||
public static Map<String, EsField> compatible(Map<String, EsField> mapping, Version version) { | ||
for (Map.Entry<String, EsField> entry : mapping.entrySet()) { | ||
EsField esField = entry.getValue(); | ||
DataType dataType = esField.getDataType(); | ||
if (isPrimitive(dataType) == false) { | ||
compatible(esField.getProperties(), version); | ||
} else if (isTypeSupportedInVersion(dataType, version) == false) { | ||
EsField field = new UnsupportedEsField(entry.getKey(), dataType.name(), null, esField.getProperties()); | ||
entry.setValue(field); | ||
propagateUnsupportedType(entry.getKey(), dataType.name(), esField.getProperties()); | ||
} | ||
} | ||
return mapping; | ||
} | ||
|
||
public static EsIndex compatible(EsIndex esIndex, Version version) { | ||
compatible(esIndex.mapping(), version); | ||
return esIndex; | ||
} | ||
|
||
public static IndexResolution compatible(IndexResolution indexResolution, Version version) { | ||
if (indexResolution.isValid()) { | ||
compatible(indexResolution.get(), version); | ||
} | ||
return indexResolution; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
.../plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/VersionCompatibilityChecks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.ql.index; | ||
|
||
import org.elasticsearch.Version; | ||
import org.elasticsearch.core.Nullable; | ||
import org.elasticsearch.xpack.ql.type.DataType; | ||
|
||
import static org.elasticsearch.Version.V_8_2_0; | ||
import static org.elasticsearch.xpack.ql.type.DataTypes.UNSIGNED_LONG; | ||
|
||
public final class VersionCompatibilityChecks { | ||
|
||
public static final Version INTRODUCING_UNSIGNED_LONG = V_8_2_0; | ||
|
||
private VersionCompatibilityChecks() {} | ||
|
||
public static boolean isTypeSupportedInVersion(DataType dataType, Version version) { | ||
if (dataType == UNSIGNED_LONG) { | ||
return supportsUnsignedLong(version); | ||
} | ||
return true; | ||
} | ||
|
||
/** | ||
* Does the provided {@code version} support the unsigned_long type (PR#60050)? | ||
*/ | ||
public static boolean supportsUnsignedLong(Version version) { | ||
return INTRODUCING_UNSIGNED_LONG.compareTo(version) <= 0; | ||
} | ||
|
||
public static @Nullable Version versionIntroducingType(DataType dataType) { | ||
if (dataType == UNSIGNED_LONG) { | ||
return INTRODUCING_UNSIGNED_LONG; | ||
} | ||
|
||
return null; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this new method creates a bwc issue in mixed node environments. Maybe consider bumping the
minCompatibleShardNode
version inorg/elasticsearch/xpack/sql/execution/search/Querier.java:147
and cover it inSqlCompatIT
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the
minCompatibleShardNode
.The test with bwcVersion nodes would fail indeed, but due to missing UL SQL support, not just missing script, while script support current version nodes is validated in other tests, so not sure how to add a meaningful test specifically for this.