当前位置: 首页>>代码示例>>Java>>正文


Java Slice.compareTo方法代码示例

本文整理汇总了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);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:37,代码来源:ShardStats.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarcharOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarcharOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarcharOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarcharOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarcharOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarbinaryOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarbinaryOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarbinaryOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarbinaryOperators.java

示例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;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:VarbinaryOperators.java


注:本文中的io.airlift.slice.Slice.compareTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。