com.facebook.presto.spi.predicate.Marker.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(12.0k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中com.facebook.presto.spi.predicate.Marker.getValue()方法的一些代码示例,展示了Marker.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Marker.getValue()方法的具体详情如下:
包路径:com.facebook.presto.spi.predicate.Marker
类名称:Marker
方法名:getValue

Marker.getValue介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

public Object getSingleValue()
{
  if (!isSingleValue()) {
    throw new IllegalStateException("Range does not have just a single value");
  }
  return low.getValue();
}

代码示例来源:origin: prestodb/presto

private FormattedMarker formatMarker(Marker marker)
{
  if (!marker.getValueBlock().isPresent()) {
    return new FormattedMarker(Optional.empty(), marker.getBound());
  }
  return new FormattedMarker(Optional.of(getVarcharValue(marker.getType(), marker.getValue())), marker.getBound());
}

代码示例来源:origin: prestodb/presto

builder.append(castToVarchar(type, range.getLow().getValue(), functionRegistry, session));
builder.append(castToVarchar(type, range.getHigh().getValue(), functionRegistry, session));

代码示例来源:origin: prestodb/presto

private static OptionalInt extractUpperBound(TupleDomain<Symbol> tupleDomain, Symbol symbol)
{
  if (tupleDomain.isNone()) {
    return OptionalInt.empty();
  }
  Domain rowNumberDomain = tupleDomain.getDomains().get().get(symbol);
  if (rowNumberDomain == null) {
    return OptionalInt.empty();
  }
  ValueSet values = rowNumberDomain.getValues();
  if (values.isAll() || values.isNone() || values.getRanges().getRangeCount() <= 0) {
    return OptionalInt.empty();
  }
  Range span = values.getRanges().getSpan();
  if (span.getHigh().isUpperUnbounded()) {
    return OptionalInt.empty();
  }
  verify(rowNumberDomain.getType().equals(BIGINT));
  long upperBound = (Long) span.getHigh().getValue();
  if (span.getHigh().getBound() == BELOW) {
    upperBound--;
  }
  if (upperBound > 0 && upperBound <= Integer.MAX_VALUE) {
    return OptionalInt.of(toIntExact(upperBound));
  }
  return OptionalInt.empty();
}

代码示例来源:origin: prestodb/presto

checkState(!range.isAll());
if (range.isSingleValue()) {
  singleValues.add(range.getLow().getValue());
  continue;
  switch (range.getLow().getBound()) {
    case ABOVE:
      rangeConjuncts.add(toPredicate(">", range.getLow().getValue(), type, position));
      break;
    case EXACTLY:
      rangeConjuncts.add(toPredicate(">=", range.getLow().getValue(), type, position));
      break;
    case BELOW:
      throw new IllegalArgumentException("High marker should never use ABOVE bound");
    case EXACTLY:
      rangeConjuncts.add(toPredicate("<=", range.getHigh().getValue(), type, position));
      break;
    case BELOW:
      rangeConjuncts.add(toPredicate("<", range.getHigh().getValue(), type, position));
      break;
    default:

代码示例来源:origin: prestodb/presto

singleValues.add(range.getLow().getValue());
  switch (range.getLow().getBound()) {
    case ABOVE:
      rangeConjuncts.add(toPredicate(columnName, ">", range.getLow().getValue(), type, accumulator));
      break;
    case EXACTLY:
      rangeConjuncts.add(toPredicate(columnName, ">=", range.getLow().getValue(), type, accumulator));
      break;
    case BELOW:
      throw new IllegalArgumentException("High marker should never use ABOVE bound");
    case EXACTLY:
      rangeConjuncts.add(toPredicate(columnName, "<=", range.getHigh().getValue(), type, accumulator));
      break;
    case BELOW:
      rangeConjuncts.add(toPredicate(columnName, "<", range.getHigh().getValue(), type, accumulator));
      break;
    default:

代码示例来源:origin: prestodb/presto

return new BetweenPredicate(reference, literalEncoder.toExpression(range.getLow().getValue(), type), literalEncoder.toExpression(range.getHigh().getValue(), type));
switch (range.getLow().getBound()) {
  case ABOVE:
    rangeConjuncts.add(new ComparisonExpression(GREATER_THAN, reference, literalEncoder.toExpression(range.getLow().getValue(), type)));
    break;
  case EXACTLY:
    rangeConjuncts.add(new ComparisonExpression(GREATER_THAN_OR_EQUAL, reference, literalEncoder.toExpression(range.getLow().getValue(),
        type)));
    break;
    throw new IllegalStateException("High Marker should never use ABOVE bound: " + range);
  case EXACTLY:
    rangeConjuncts.add(new ComparisonExpression(LESS_THAN_OR_EQUAL, reference, literalEncoder.toExpression(range.getHigh().getValue(), type)));
    break;
  case BELOW:
    rangeConjuncts.add(new ComparisonExpression(LESS_THAN, reference, literalEncoder.toExpression(range.getHigh().getValue(), type)));
    break;
  default:

代码示例来源:origin: prestodb/presto

switch (range.getLow().getBound()) {
  case ABOVE:
    rangeConjuncts.put(GT_OP, translateValue(range.getLow().getValue(), type));
    break;
  case EXACTLY:
    rangeConjuncts.put(GTE_OP, translateValue(range.getLow().getValue(), type));
    break;
  case BELOW:
    throw new IllegalArgumentException("High Marker should never use ABOVE bound: " + range);
  case EXACTLY:
    rangeConjuncts.put(LTE_OP, translateValue(range.getHigh().getValue(), type));
    break;
  case BELOW:
    rangeConjuncts.put(LT_OP, translateValue(range.getHigh().getValue(), type));
    break;
  default:

代码示例来源:origin: prestodb/presto

case ABOVE:
  rangeConjuncts.add(CassandraCqlUtils.validColumnName(columnHandle.getName()) + " > "
      + CassandraCqlUtils.cqlValue(toCQLCompatibleString(range.getLow().getValue()),
      columnHandle.getCassandraType()));
  break;
case EXACTLY:
  rangeConjuncts.add(CassandraCqlUtils.validColumnName(columnHandle.getName()) + " >= "
      + CassandraCqlUtils.cqlValue(toCQLCompatibleString(range.getLow().getValue()),
      columnHandle.getCassandraType()));
  break;
case EXACTLY:
  rangeConjuncts.add(CassandraCqlUtils.validColumnName(columnHandle.getName()) + " <= "
      + CassandraCqlUtils.cqlValue(toCQLCompatibleString(range.getHigh().getValue()),
      columnHandle.getCassandraType()));
  break;
case BELOW:
  rangeConjuncts.add(CassandraCqlUtils.validColumnName(columnHandle.getName()) + " < "
      + CassandraCqlUtils.cqlValue(toCQLCompatibleString(range.getHigh().getValue()),
      columnHandle.getCassandraType()));
  break;

代码示例来源:origin: prestodb/presto

checkState(!range.isAll(), "Invalid range for column: " + columnName);
if (range.isSingleValue()) {
  valuesToInclude.add(range.getLow().getValue());
    switch (range.getLow().getBound()) {
      case ABOVE:
        rangeQueryBuilder.must(new RangeQueryBuilder(columnName).gt(getValue(type, range.getLow().getValue())));
        break;
      case EXACTLY:
        rangeQueryBuilder.must(new RangeQueryBuilder(columnName).gte(getValue(type, range.getLow().getValue())));
        break;
      case BELOW:
    switch (range.getHigh().getBound()) {
      case EXACTLY:
        rangeQueryBuilder.must(new RangeQueryBuilder(columnName).lte(getValue(type, range.getHigh().getValue())));
        break;
      case BELOW:
        rangeQueryBuilder.must(new RangeQueryBuilder(columnName).lt(getValue(type, range.getHigh().getValue())));
        break;
      case ABOVE:

代码示例来源:origin: prestodb/presto

Text split = new Text(serializer.encode(prestoRange.getType(), prestoRange.getHigh().getValue()));
accumuloRange = new Range(null, false, split, inclusive);
Text split = new Text(serializer.encode(prestoRange.getType(), prestoRange.getLow().getValue()));
accumuloRange = new Range(split, inclusive, null, false);
Text startSplit = new Text(serializer.encode(prestoRange.getType(), prestoRange.getLow().getValue()));
Text endSplit = new Text(serializer.encode(prestoRange.getType(), prestoRange.getHigh().getValue()));
accumuloRange = new Range(startSplit, startKeyInclusive, endSplit, endKeyInclusive);

代码示例来源:origin: prestodb/presto

KuduPredicate.ComparisonOp op = (low.getBound() == Marker.Bound.ABOVE)
    ? KuduPredicate.ComparisonOp.GREATER : KuduPredicate.ComparisonOp.GREATER_EQUAL;
KuduPredicate predicate = createComparisonPredicate(columnSchema, op, low.getValue());
builder.addPredicate(predicate);
KuduPredicate.ComparisonOp op = (low.getBound() == Marker.Bound.BELOW)
    ? KuduPredicate.ComparisonOp.LESS : KuduPredicate.ComparisonOp.LESS_EQUAL;
KuduPredicate predicate = createComparisonPredicate(columnSchema, op, high.getValue());
builder.addPredicate(predicate);

代码示例来源:origin: com.facebook.presto/presto-spi

public Object getSingleValue()
{
  if (!isSingleValue()) {
    throw new IllegalStateException("Range does not have just a single value");
  }
  return low.getValue();
}

代码示例来源:origin: xiaoyao1991/presto-ethereum

public static EthereumBlockRange fromMarkers(Marker low, Marker high) {
  long startBlock;
  long endBlock;
  if (low.isLowerUnbounded()) {
    startBlock = 1L;
  } else if (low.getBound() == Marker.Bound.EXACTLY) {
    startBlock = (long) low.getValue();
  } else if (low.getBound() == Marker.Bound.ABOVE) {
    startBlock = (long) low.getValue() + 1L;
  } else {
    throw new IllegalArgumentException("Low bound cannot be BELOW");
  }
  if (high.isUpperUnbounded()) {
    endBlock = -1L;
  } else if (high.getBound() == Marker.Bound.EXACTLY) {
    endBlock = (long) high.getValue();
  } else if (high.getBound() == Marker.Bound.BELOW) {
    endBlock = (long) high.getValue() - 1L;
  } else {
    throw new IllegalArgumentException("High bound cannot be ABOVE");
  }
  if (startBlock > endBlock && endBlock != -1L) {
    throw new IllegalArgumentException("Low bound is greater than high bound");
  }
  return new EthereumBlockRange(startBlock, endBlock);
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

private static OptionalInt extractUpperBound(TupleDomain<Symbol> tupleDomain, Symbol symbol)
{
  if (tupleDomain.isNone()) {
    return OptionalInt.empty();
  }
  Domain rowNumberDomain = tupleDomain.getDomains().get().get(symbol);
  if (rowNumberDomain == null) {
    return OptionalInt.empty();
  }
  ValueSet values = rowNumberDomain.getValues();
  if (values.isAll() || values.isNone() || values.getRanges().getRangeCount() <= 0) {
    return OptionalInt.empty();
  }
  Range span = values.getRanges().getSpan();
  if (span.getHigh().isUpperUnbounded()) {
    return OptionalInt.empty();
  }
  verify(rowNumberDomain.getType().equals(BIGINT));
  long upperBound = (Long) span.getHigh().getValue();
  if (span.getHigh().getBound() == BELOW) {
    upperBound--;
  }
  if (upperBound > Integer.MAX_VALUE) {
    return OptionalInt.empty();
  }
  return OptionalInt.of(Ints.checkedCast(upperBound));
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

return new BetweenPredicate(reference, toExpression(range.getLow().getValue(), type), toExpression(range.getHigh().getValue(), type));
switch (range.getLow().getBound()) {
  case ABOVE:
    rangeConjuncts.add(new ComparisonExpression(GREATER_THAN, reference, toExpression(range.getLow().getValue(), type)));
    break;
  case EXACTLY:
    rangeConjuncts.add(new ComparisonExpression(GREATER_THAN_OR_EQUAL, reference, toExpression(range.getLow().getValue(),
        type)));
    break;
    throw new IllegalStateException("High Marker should never use ABOVE bound: " + range);
  case EXACTLY:
    rangeConjuncts.add(new ComparisonExpression(LESS_THAN_OR_EQUAL, reference, toExpression(range.getHigh().getValue(), type)));
    break;
  case BELOW:
    rangeConjuncts.add(new ComparisonExpression(LESS_THAN, reference, toExpression(range.getHigh().getValue(), type)));
    break;
  default:

代码示例来源:origin: harbby/presto-connectors

Object value = prestoRange.getHigh().getValue();
hbaseScan.setStopRow(toHbaseBytes(type, value));
Object value = prestoRange.getLow().getValue();
hbaseScan.setStartRow(toHbaseBytes(type, value));
Object startSplit = prestoRange.getLow().getValue();
Object endSplit = prestoRange.getHigh().getValue();

代码示例来源:origin: harbby/presto-connectors

if (prestoRange.getHigh().isUpperUnbounded()) {
  Object value = prestoRange.getLow().getValue();
  qb.must(QueryBuilders.rangeQuery(columnName).gte(EsTypeManager.getTypeValue(type, value)));
  Object value = prestoRange.getHigh().getValue();
  qb.must(QueryBuilders.rangeQuery(columnName).lte(EsTypeManager.getTypeValue(type, value)));
  Object startSplit = EsTypeManager.getTypeValue(type, prestoRange.getLow().getValue());
  Object endSplit = EsTypeManager.getTypeValue(type, prestoRange.getHigh().getValue());

代码示例来源:origin: harbby/presto-connectors

if (prestoRange.getHigh().isUpperUnbounded()) {
  Object value = prestoRange.getLow().getValue();
  qb.must(QueryBuilders.rangeQuery(columnName).gte(EsTypeManager.getTypeValue(type, value)));
  Object value = prestoRange.getHigh().getValue();
  qb.must(QueryBuilders.rangeQuery(columnName).lte(EsTypeManager.getTypeValue(type, value)));
  Object startSplit = EsTypeManager.getTypeValue(type, prestoRange.getLow().getValue());
  Object endSplit = EsTypeManager.getTypeValue(type, prestoRange.getHigh().getValue());

代码示例来源:origin: harbby/presto-connectors

if (prestoRange.getHigh().isUpperUnbounded()) {
  Object value = prestoRange.getLow().getValue();
  qb.must(QueryBuilders.rangeQuery(columnName).gte(EsTypeManager.getTypeValue(type, value)));
  Object value = prestoRange.getHigh().getValue();
  qb.must(QueryBuilders.rangeQuery(columnName).lte(EsTypeManager.getTypeValue(type, value)));
  Object startSplit = EsTypeManager.getTypeValue(type, prestoRange.getLow().getValue());
  Object endSplit = EsTypeManager.getTypeValue(type, prestoRange.getHigh().getValue());

相关文章