Class InputTextReader
java.lang.Object
org.elasticsearch.xpack.esql.inference.InputTextReader
- All Implemented Interfaces:
Closeable,AutoCloseable,org.elasticsearch.core.Releasable
Helper class that reads text strings from a
BytesRefBlock.
This class is used by inference operators to extract text content from block data.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intReturns the total number of positions (text entries) in the block.booleanisNull(int pos) Checks if the value at the given position is null.readText(int pos) Reads the text string at the given position.readText(int pos, int limit) Reads the text string at the given position.
-
Constructor Details
-
InputTextReader
-
-
Method Details
-
isNull
public boolean isNull(int pos) Checks if the value at the given position is null.- Parameters:
pos- the position index in the block- Returns:
- true if the position contains a null value, false otherwise
-
readText
Reads the text string at the given position. Multiple values at the position are concatenated with newlines.- Parameters:
pos- the position index in the block- Returns:
- the text string at the position, or null if the position contains a null value
-
readText
Reads the text string at the given position.- Parameters:
pos- the position index in the blocklimit- the maximum number of value to read from the position- Returns:
- the text string at the position, or null if the position contains a null value
-
estimatedSize
public int estimatedSize()Returns the total number of positions (text entries) in the block. -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-