com.datastax.driver.core.querybuilder.Select.allowFiltering()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(254)

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

Select.allowFiltering介绍

[英]Adds an ALLOW FILTERING directive to this statement.
[中]将ALLOW FILTERING指令添加到此语句。

代码示例

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

/**
  * Adds an {@code ALLOW FILTERING} directive to the {@code SELECT} statement this {@code WHERE}
  * clause is part of.
  *
  * @return the {@code SELECT} statement this {@code WHERE} clause is part of.
  */
 public Select allowFiltering() {
  return statement.allowFiltering();
 }
}

代码示例来源:origin: hugegraph/hugegraph

protected Collection<Select> queryCondition2Select(Query query,
                          Select select) {
  // Query by conditions
  Set<Condition> conditions = query.conditions();
  for (Condition condition : conditions) {
    Clause clause = condition2Cql(condition);
    select.where(clause);
    if (Clauses.needAllowFiltering(clause)) {
      select.allowFiltering();
    }
  }
  return ImmutableList.of(select);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

/** @test_category queries:builder */
 @Test(groups = "unit")
 public void should_handle_allow_filtering() {
  assertThat(select().all().from("foo").allowFiltering().toString())
    .isEqualTo("SELECT * FROM foo ALLOW FILTERING;");
  assertThat(select().all().from("foo").where(eq("x", 42)).allowFiltering().toString())
    .isEqualTo("SELECT * FROM foo WHERE x=42 ALLOW FILTERING;");
 }
}

代码示例来源:origin: otaviojava/Easy-Cassandra

@Override
public SelectBuilder<T> allowFiltering() {
  select.allowFiltering();
  return this;
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

select = select().writeTime("a) FROM bar; --").ttl("a").from("foo").allowFiltering();
assertEquals(select.toString(), query);
select = select().writeTime("a").ttl("a) FROM bar; --").from("foo").allowFiltering();
assertEquals(select.toString(), query);

代码示例来源:origin: hugegraph/hugegraph

select.allowFiltering();

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

select = select().writeTime("a").ttl("a").from("foo").allowFiltering();
assertEquals(select.toString(), query);

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

.perPartitionLimit(bindMarker())
    .limit(3)
    .allowFiltering()
    .toString())
.isEqualTo(

代码示例来源:origin: com.baidu.hugegraph/hugegraph-cassandra

protected Collection<Select> queryCondition2Select(Query query,
                          Select select) {
  // Query by conditions
  Set<Condition> conditions = query.conditions();
  for (Condition condition : conditions) {
    Clause clause = condition2Cql(condition);
    select.where(clause);
    if (Clauses.needAllowFiltering(clause)) {
      select.allowFiltering();
    }
  }
  return ImmutableList.of(select);
}

代码示例来源:origin: tech.aroma.banana/banana-data-operations

private Statement createQueryForRecentlyCreatedApps()
{
  return queryBuilder
    .select()
    .all()
    .from(TABLE_NAME_RECENTLY_CREATED)
    .limit(200)
    .allowFiltering();
}

代码示例来源:origin: tech.aroma/aroma-data-operations

private Statement createQueryForRecentlyCreatedApps()
{
  return QueryBuilder
    .select()
    .all()
    .from(TABLE_NAME_RECENTLY_CREATED)
    .limit(200)
    .allowFiltering();
}

代码示例来源:origin: org.springframework.data/spring-data-cassandra

private Select createSelect(Query query, CassandraPersistentEntity<?> entity, Filter filter,
    List<Selector> selectors, CqlIdentifier tableName) {
  Sort sort = Optional.of(query.getSort()).map(querySort -> getQueryMapper().getMappedSort(querySort, entity))
      .orElse(Sort.unsorted());
  Select select = createSelectAndOrder(selectors, tableName, filter, sort);
  query.getQueryOptions().ifPresent(queryOptions -> QueryOptionsUtil.addQueryOptions(select, queryOptions));
  if (query.getLimit() > 0) {
    select.limit(Ints.checkedCast(query.getLimit()));
  }
  if (query.isAllowFiltering()) {
    select.allowFiltering();
  }
  query.getPagingState().ifPresent(select::setPagingState);
  return select;
}

代码示例来源:origin: dmart28/gcplot

@Override
public Iterable<GCAnalyse> analyses(boolean isContinuous) {
  Statement statement = QueryBuilder.select().all().from(TABLE_NAME).allowFiltering()
      .where(eq("is_continuous", isContinuous));
  return analysesFrom(connector.session().execute(statement));
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

.where(eq("b", 2))
        .groupBy("a", "b")
        .allowFiltering()))
.containsExactly(row(1, 2, 6, 2L, 12), row(2, 2, 6, 1L, 6));

代码示例来源:origin: org.apache.gora/gora-cassandra

/**
 * This method returns CQL Select query to retrieve data from the table with given fields.
 * This method is used for Avro Serialization
 * refer: http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlSelect.html
 *
 * @param mapping   Cassandra Mapping {@link CassandraMapping}
 * @param fields    Given fields to retrieve
 * @param keyFields key fields
 * @return CQL Query
 */
static String getSelectObjectWithFieldsQuery(CassandraMapping mapping, String[] fields, List<String> keyFields) {
 Select select = QueryBuilder.select(getColumnNames(mapping, Arrays.asList(fields))).from(mapping.getKeySpace().getName(), mapping.getCoreName());
 if (Boolean.parseBoolean(mapping.getProperty("allowFiltering"))) {
  select.allowFiltering();
 }
 String[] columnNames = getColumnNames(mapping, keyFields);
 return processKeys(columnNames, select);
}

代码示例来源:origin: apache/gora

/**
 * This method returns the CQL Select query to retrieve data from the table.
 * refer: http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlSelect.html
 *
 * @param mapping   Cassandra Mapping {@link CassandraMapping}
 * @param keyFields key fields
 * @return CQL Query
 */
static String getSelectObjectQuery(CassandraMapping mapping, List<String> keyFields) {
 Select select = QueryBuilder.select().from(mapping.getKeySpace().getName(), mapping.getCoreName());
 if (Boolean.parseBoolean(mapping.getProperty("allowFiltering"))) {
  select.allowFiltering();
 }
 String[] columnNames = getColumnNames(mapping, keyFields);
 return processKeys(columnNames, select);
}

代码示例来源:origin: org.apache.gora/gora-cassandra

/**
 * This method returns the CQL Select query to retrieve data from the table.
 * refer: http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlSelect.html
 *
 * @param mapping   Cassandra Mapping {@link CassandraMapping}
 * @param keyFields key fields
 * @return CQL Query
 */
static String getSelectObjectQuery(CassandraMapping mapping, List<String> keyFields) {
 Select select = QueryBuilder.select().from(mapping.getKeySpace().getName(), mapping.getCoreName());
 if (Boolean.parseBoolean(mapping.getProperty("allowFiltering"))) {
  select.allowFiltering();
 }
 String[] columnNames = getColumnNames(mapping, keyFields);
 return processKeys(columnNames, select);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

.and(gt("b", bindMarker()))
  .perPartitionLimit(bindMarker())
  .allowFiltering()
  .getQueryString(),
2,
  .orderBy(desc("b"))
  .perPartitionLimit(bindMarker())
  .allowFiltering()
  .getQueryString(),
2,

代码示例来源:origin: com.datastax.dse/dse-java-driver-core

/** @test_category queries:builder */
@Test(groups = "unit")
public void should_handle_allow_filtering() {
 assertThat(select().all().from("foo").allowFiltering().toString())
   .isEqualTo("SELECT * FROM foo ALLOW FILTERING;");
 assertThat(select().all().from("foo").where(eq("x", 42)).allowFiltering().toString())
   .isEqualTo("SELECT * FROM foo WHERE x=42 ALLOW FILTERING;");
}

代码示例来源:origin: Stratio/stratio-cassandra-test

public List<Row> selectAllFromIndexQueryWithFiltering(int limit, String name, Object value) {
  String search = search().query(all()).refresh(true).toJson();
  return execute(QueryBuilder.select()
                .from(keyspace, table)
                .where(QueryBuilder.eq(indexColumn, search))
                .and(QueryBuilder.eq(name, value))
                .limit(limit)
                .allowFiltering()
                .setConsistencyLevel(consistencyLevel));
}

相关文章