org.apache.druid.query.Query.getContextBoolean()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(148)

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

Query.getContextBoolean介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-druid

@Override
public boolean getContextBoolean(String key, boolean defaultValue) 
{
 return query.getContextBoolean(key, defaultValue);
}

代码示例来源:origin: apache/incubator-druid

@Nullable
public static Filter convertToCNFFromQueryContext(Query query, @Nullable Filter filter)
{
 if (filter == null) {
  return null;
 }
 boolean useCNF = query.getContextBoolean(CTX_KEY_USE_FILTER_CNF, false);
 return useCNF ? convertToCNF(filter) : filter;
}

代码示例来源:origin: apache/incubator-druid

@Override
 public Sequence<T> run(final QueryPlus<T> queryPlus, Map<String, Object> responseContext)
 {
  DataSource dataSource = queryPlus.getQuery().getDataSource();
  boolean forcePushDownNestedQuery = queryPlus.getQuery()
                        .getContextBoolean(
                          GroupByQueryConfig.CTX_KEY_FORCE_PUSH_DOWN_NESTED_QUERY,
                          false
                        );
  if (dataSource instanceof QueryDataSource && !forcePushDownNestedQuery) {
   return run(queryPlus.withQuery((Query<T>) ((QueryDataSource) dataSource).getQuery()), responseContext);
  } else {
   QueryPlus newQuery = queryPlus;
   if (forcePushDownNestedQuery) {
    // Disable any more push downs before firing off the query. But do let the historical know
    // that it is executing the complete nested query and not just the inner most part of it
    newQuery = queryPlus.withQuery(
      queryPlus.getQuery()
           .withOverriddenContext(
             ImmutableMap.of(
               GroupByQueryConfig.CTX_KEY_FORCE_PUSH_DOWN_NESTED_QUERY, false,
               GroupByQueryConfig.CTX_KEY_EXECUTING_NESTED_QUERY, true
             )
           )
    );
   }
   return baseRunner.run(newQuery, responseContext);
  }
 }
}

代码示例来源:origin: apache/incubator-druid

Assert.assertEquals("true", serdeQuery.getContextValue("populateCache"));
Assert.assertEquals(true, serdeQuery.getContextValue("finalize"));
Assert.assertEquals(true, serdeQuery.getContextBoolean("useCache", false));
Assert.assertEquals(true, serdeQuery.getContextBoolean("populateCache", false));
Assert.assertEquals(true, serdeQuery.getContextBoolean("finalize", false));

代码示例来源:origin: org.apache.druid/druid-processing

@Nullable
public static Filter convertToCNFFromQueryContext(Query query, @Nullable Filter filter)
{
 if (filter == null) {
  return null;
 }
 boolean useCNF = query.getContextBoolean(CTX_KEY_USE_FILTER_CNF, false);
 return useCNF ? convertToCNF(filter) : filter;
}

相关文章