本文整理汇总了Java中io.airlift.slice.Slice.compareTo方法的典型用法代码示例。如果您正苦于以下问题:Java Slice.compareTo方法的具体用法?Java Slice.compareTo怎么用?Java Slice.compareTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.airlift.slice.Slice
的用法示例。
在下文中一共展示了Slice.compareTo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: indexString
import io.airlift.slice.Slice; //导入方法依赖的package包/类
private static ColumnStats indexString(Type type, OrcRecordReader reader, int columnIndex, long columnId)
throws IOException
{
boolean minSet = false;
boolean maxSet = false;
Slice min = null;
Slice max = null;
while (true) {
int batchSize = reader.nextBatch();
if (batchSize <= 0) {
break;
}
Block block = reader.readBlock(type, columnIndex);
for (int i = 0; i < batchSize; i++) {
if (block.isNull(i)) {
continue;
}
Slice slice = type.getSlice(block, i);
slice = truncateIndexValue(slice);
if (!minSet || (slice.compareTo(min) < 0)) {
minSet = true;
min = slice;
}
if (!maxSet || (slice.compareTo(max) > 0)) {
maxSet = true;
max = slice;
}
}
}
return new ColumnStats(columnId,
minSet ? min.toStringUtf8() : null,
maxSet ? max.toStringUtf8() : null);
}
示例2: lessThan
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(LESS_THAN)
@SqlType(StandardTypes.BOOLEAN)
public static boolean lessThan(@SqlType(StandardTypes.VARCHAR) Slice left, @SqlType(StandardTypes.VARCHAR) Slice right)
{
return left.compareTo(right) < 0;
}
示例3: lessThanOrEqual
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(LESS_THAN_OR_EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean lessThanOrEqual(@SqlType(StandardTypes.VARCHAR) Slice left, @SqlType(StandardTypes.VARCHAR) Slice right)
{
return left.compareTo(right) <= 0;
}
示例4: greaterThan
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(GREATER_THAN)
@SqlType(StandardTypes.BOOLEAN)
public static boolean greaterThan(@SqlType(StandardTypes.VARCHAR) Slice left, @SqlType(StandardTypes.VARCHAR) Slice right)
{
return left.compareTo(right) > 0;
}
示例5: greaterThanOrEqual
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(GREATER_THAN_OR_EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean greaterThanOrEqual(@SqlType(StandardTypes.VARCHAR) Slice left, @SqlType(StandardTypes.VARCHAR) Slice right)
{
return left.compareTo(right) >= 0;
}
示例6: between
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(BETWEEN)
@SqlType(StandardTypes.BOOLEAN)
public static boolean between(@SqlType(StandardTypes.VARCHAR) Slice value, @SqlType(StandardTypes.VARCHAR) Slice min, @SqlType(StandardTypes.VARCHAR) Slice max)
{
return min.compareTo(value) <= 0 && value.compareTo(max) <= 0;
}
示例7: lessThan
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(LESS_THAN)
@SqlType(StandardTypes.BOOLEAN)
public static boolean lessThan(@SqlType(StandardTypes.VARBINARY) Slice left, @SqlType(StandardTypes.VARBINARY) Slice right)
{
return left.compareTo(right) < 0;
}
示例8: lessThanOrEqual
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(LESS_THAN_OR_EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean lessThanOrEqual(@SqlType(StandardTypes.VARBINARY) Slice left, @SqlType(StandardTypes.VARBINARY) Slice right)
{
return left.compareTo(right) <= 0;
}
示例9: greaterThan
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(GREATER_THAN)
@SqlType(StandardTypes.BOOLEAN)
public static boolean greaterThan(@SqlType(StandardTypes.VARBINARY) Slice left, @SqlType(StandardTypes.VARBINARY) Slice right)
{
return left.compareTo(right) > 0;
}
示例10: greaterThanOrEqual
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(GREATER_THAN_OR_EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean greaterThanOrEqual(@SqlType(StandardTypes.VARBINARY) Slice left, @SqlType(StandardTypes.VARBINARY) Slice right)
{
return left.compareTo(right) >= 0;
}
示例11: between
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(BETWEEN)
@SqlType(StandardTypes.BOOLEAN)
public static boolean between(@SqlType(StandardTypes.VARBINARY) Slice value, @SqlType(StandardTypes.VARBINARY) Slice min, @SqlType(StandardTypes.VARBINARY) Slice max)
{
return min.compareTo(value) <= 0 && value.compareTo(max) <= 0;
}