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


Java Description类代码示例

本文整理汇总了Java中com.facebook.presto.spi.function.Description的典型用法代码示例。如果您正苦于以下问题:Java Description类的具体用法?Java Description怎么用?Java Description使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Description类属于com.facebook.presto.spi.function包,在下文中一共展示了Description类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fromWei

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@ScalarFunction("fromWei")
@Description("fromWei")
@SqlType(StandardTypes.DOUBLE)
public static double fromWei(@SqlType(StandardTypes.DOUBLE) double num, @SqlType(StandardTypes.VARCHAR) Slice unit) {
    String unitStr = unit.toStringUtf8().toUpperCase();
    EthereumUnit u = EthereumUnit.valueOf(unitStr);
    return u.fromWei(num);
}
 
开发者ID:xiaoyao1991,项目名称:presto-ethereum,代码行数:9,代码来源:EthereumUDFs.java

示例2: toWei

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@ScalarFunction("toWei")
@Description("toWei")
@SqlType(StandardTypes.DOUBLE)
public static double toWei(@SqlType(StandardTypes.DOUBLE) double num, @SqlType(StandardTypes.VARCHAR) Slice unit) {
    String unitStr = unit.toStringUtf8().toUpperCase();
    EthereumUnit u = EthereumUnit.valueOf(unitStr);
    return u.toWei(num);
}
 
开发者ID:xiaoyao1991,项目名称:presto-ethereum,代码行数:9,代码来源:EthereumUDFs.java

示例3: hllCardinality

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@Description("Returns the approximate cardinality of a HLL")
@ScalarFunction("cardinality")
@SqlType(StandardTypes.BIGINT)
public static long hllCardinality(@SqlType(HyperLogLogType.TYPE) Slice hll)
{
    return (Long) HyperLogLog.fromBytes(hll.getBytes()).approximateSize().estimate();
}
 
开发者ID:vitillo,项目名称:presto-hyperloglog,代码行数:8,代码来源:HyperLogLogScalarFunctions.java

示例4: hllCreate

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@Description("Create a HLL from a string")
@ScalarFunction("hll_create")
@SqlType(HyperLogLogType.TYPE)
public static Slice hllCreate(@SqlType(StandardTypes.VARCHAR) Slice string, @SqlType(StandardTypes.BIGINT) long bits)
{
    HyperLogLogMonoid monoid = new HyperLogLogMonoid((int) bits);
    DenseHLL hll = monoid.create(string.getBytes()).toDenseHLL();
    return Slices.wrappedBuffer(HyperLogLog.toBytes(hll));
}
 
开发者ID:vitillo,项目名称:presto-hyperloglog,代码行数:10,代码来源:HyperLogLogScalarFunctions.java

示例5: bloomFilterFalsePositivePercentage

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@Description(value = "Display expected insertions from the bloom filter")
@Nullable
@SqlNullable
@SqlType(StandardTypes.DOUBLE)
public static Double bloomFilterFalsePositivePercentage(@SqlNullable @SqlType(BloomFilterType.TYPE) Slice bloomFilterSlice)
{
    BloomFilter bf = getOrLoadBloomFilter(bloomFilterSlice);
    return bf.getFalsePositivePercentage();
}
 
开发者ID:RobinUS2,项目名称:presto-bloomfilter,代码行数:10,代码来源:BloomFilterGetFalsePositivePercentageScalarFunction.java

示例6: ethGasPrice

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@ScalarFunction("eth_gasPrice")
@Description("Returns current gas price")
@SqlType(StandardTypes.DOUBLE)
public static double ethGasPrice() throws IOException {
    return web3j.ethGasPrice().send().getGasPrice().doubleValue();
}
 
开发者ID:xiaoyao1991,项目名称:presto-ethereum,代码行数:7,代码来源:EthereumUDFs.java

示例7: ethBlockNumber

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@ScalarFunction("eth_blockNumber")
@Description("Returns current block number")
@SqlType(StandardTypes.BIGINT)
public static long ethBlockNumber() throws IOException {
    return web3j.ethBlockNumber().send().getBlockNumber().longValue();
}
 
开发者ID:xiaoyao1991,项目名称:presto-ethereum,代码行数:7,代码来源:EthereumUDFs.java

示例8: ethGetBalance

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@ScalarFunction("eth_getBalance")
@Description("Returns the balance of an address")
@SqlType(StandardTypes.DOUBLE)
public static double ethGetBalance(@SqlType(StandardTypes.VARCHAR) Slice address) throws IOException {
    return web3j.ethGetBalance(address.toStringUtf8(), DefaultBlockParameter.valueOf(LATEST)).send().getBalance().doubleValue();
}
 
开发者ID:xiaoyao1991,项目名称:presto-ethereum,代码行数:7,代码来源:EthereumUDFs.java

示例9: ethGetTransactionCount

import com.facebook.presto.spi.function.Description; //导入依赖的package包/类
@ScalarFunction("eth_getTransactionCount")
@Description("Returns the number of transactions from this address")
@SqlType(StandardTypes.BIGINT)
public static long ethGetTransactionCount(@SqlType(StandardTypes.VARCHAR) Slice address) throws IOException {
    return web3j.ethGetTransactionCount(address.toStringUtf8(), DefaultBlockParameter.valueOf(LATEST)).send().getTransactionCount().longValue();
}
 
开发者ID:xiaoyao1991,项目名称:presto-ethereum,代码行数:7,代码来源:EthereumUDFs.java


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