Package org.apache.druid.frame.key
Interface FrameComparisonWidget
-
- All Known Implementing Classes:
FrameComparisonWidgetImpl
public interface FrameComparisonWidgetWraps aFrameand provides ways to compare rows of that frame to various other things. Not thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompare(int row, FrameComparisonWidget otherWidget, int otherRow)Compare a specific row of this frame to a specific row of another frame.intcompare(int row, RowKey key)Compare a specific row of this frame to the provided key.booleanhasNonNullKeyParts(int row, int[] keyParts)Whether particular key parts in a particular row are non-null.RowKeyreadKey(int row)Returns theRowKeycorresponding to a particular row.
-
-
-
Method Detail
-
readKey
RowKey readKey(int row)
-
hasNonNullKeyParts
boolean hasNonNullKeyParts(int row, int[] keyParts)Whether particular key parts in a particular row are non-null. WhenNullHandling.replaceWithDefault(), default values (like empty strings and numeric zeroes) are considered null for purposes of this method. This behavior is inherited fromFieldReader.isNull(Memory, long)and enables join code to behave similarly in MSQ and native queries.- Parameters:
row- row numberkeyParts- parts to check
-
compare
int compare(int row, RowKey key)Compare a specific row of this frame to the provided key. The key must have been created with sortColumns that match the ones used to create this widget, or else results are undefined. Comparison considers null to be equal to null. Callers that need to determine if key parts are null (perhaps because they *don't* want to consider null to be equal to null) should usehasNonNullKeyParts(int, int[])to check the relevant parts.
-
compare
int compare(int row, FrameComparisonWidget otherWidget, int otherRow)Compare a specific row of this frame to a specific row of another frame. The other frame must have the same sort key, or else results are undefined. The other frame may be the same object as this frame; for example, this is used byFrameSortto sort frames in-place. Comparison considers null to be equal to null. Callers that need to determine if key parts are null (perhaps because they *don't* want to consider null to be equal to null) should usehasNonNullKeyParts(int, int[])to check the relevant parts.
-
-