-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add blockloader to patterned_text to support ESQL #134093
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 blockloader to patterned_text to support ESQL #134093
Conversation
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
query: 'FROM test | SORT @timestamp | KEEP message, message.template_id | LIMIT 10' | ||
|
||
- match: {columns.0.name: "message"} | ||
- match: {columns.0.type: "text"} |
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.
Should this be updated to be patterned_text
? This comes from the familyType, which is text. So I think leaving as text is correct 🤔
} | ||
} | ||
|
||
public static class BytesRefsFromSimpleBinary extends AbstractBytesRefsFromBinary { |
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.
The existing BytesRefsFromBinary reader assumes some structure within the ByteRefs provided by the BinaryDocValues. Specifically, a number of value and some length and offsets for each value. The BinaryDocValues created for patterned_text has no such structure: the returned BytesRef contains a single value, which is the message string.
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.
As far as I can tell, BytesRefsFromBinary
is expecting the bytes read out of the BinaryDocValues
to be encoded in the format used by BinaryFieldMapper.CustomBinaryDocValuesField
.
Maybe add comments to both BytesRefsFromBinary
and BytesRefsFromSimpleBinary
explaining which format each expects?
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.
Ahh, that's where it's from, thanks for tracking it down! Yeah, definitely makes sense to document how they are encoded. Thanks for the review!
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.
And then let's just rename this BytesRefsFromBinary
?
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.
Just one nit, otherwise LGTM!
} | ||
} | ||
|
||
public static class BytesRefsFromSimpleBinary extends AbstractBytesRefsFromBinary { |
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.
As far as I can tell, BytesRefsFromBinary
is expecting the bytes read out of the BinaryDocValues
to be encoded in the format used by BinaryFieldMapper.CustomBinaryDocValuesField
.
Maybe add comments to both BytesRefsFromBinary
and BytesRefsFromSimpleBinary
explaining which format each expects?
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.
Left a naming suggestion, LGTM otherwise!
/** | ||
* Read BinaryDocValues encoded by {@link BinaryFieldMapper.CustomBinaryDocValuesField} | ||
*/ | ||
static class BytesRefsFromBinary extends AbstractBytesRefsFromBinary { |
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.
Maybe rename this BytesRefsFromBinary
to BytesRefsFromCustomBinary
? Given that it only works with bytes created by CustomBinaryDocValuesField?
} | ||
} | ||
|
||
public static class BytesRefsFromSimpleBinary extends AbstractBytesRefsFromBinary { |
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.
And then let's just rename this BytesRefsFromBinary
?
The existing blockloader for
patterned_text
does not work correctly. Update it so thatpatterned_text
works in ESQL.