-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix union types in CCS #128111
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
base: main
Are you sure you want to change the base?
Fix union types in CCS #128111
Conversation
Hi @dnhatn, I've created a changelog YAML for you. |
0733fc0
to
954e580
Compare
Hi @dnhatn, I've created a changelog YAML for you. |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
@@ -157,7 +157,8 @@ private BlockLoader getBlockLoaderFor(int shardId, Attribute attr, MappedFieldTy | |||
BlockLoader blockLoader = shardContext.blockLoader(getFieldName(attr), isUnsupported, fieldExtractPreference); | |||
MultiTypeEsField unionTypes = findUnionTypes(attr); | |||
if (unionTypes != null) { | |||
String indexName = shardContext.ctx.index().getName(); | |||
// Use the fully qualified name `cluster:index-name` because multiple types are resolved on coordinator with the cluster prefix | |||
String indexName = shardContext.ctx.getFullyQualifiedIndex().getName(); |
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.
This is the fix.
} | ||
|
||
static boolean canUseRemoteIndicesOnly() { | ||
return dataLocation == DataLocation.REMOTE_ONLY && Clusters.bwcVersion().onOrAfter(Version.V_9_1_0); |
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.
Worth a comment I think.
Currently, union types in CCS is broken. For example,
FROM *:remote-indices | EVAL port = TO_INT(port)
returns all nulls if the types of theport
field conflict. This happens because converters are a map of the fully qualifiedcluster:index -name
(defined in MultiTypeEsField), but we are looking up the converter using only the index name, which leads to a wrong or missing converter on remote clusters. Our tests didn't catch this because MultiClusterSpecIT generates the same index for both clusters, allowing the local converter to be used for remote indices.