clintropolis commented on code in PR #15465:
URL: https://github.com/apache/druid/pull/15465#discussion_r1447036680
##########
processing/src/main/java/org/apache/druid/query/DataSource.java:
##########
@@ -66,10 +66,14 @@ public interface DataSource
/**
* Returns true if queries on this dataSource are cacheable at both the
result level and per-segment level.
+ *
* Currently, dataSources that do not actually reference segments (like
'inline'), are not cacheable since cache keys
* are always based on segment identifiers.
*/
- boolean isCacheable(boolean isBroker);
+ default boolean isCacheable(boolean isBroker)
+ {
+ return false;
+ }
Review Comment:
why this change? I think its kind of better without the default
implementation because it forces implementors to think about whether or not the
datasource should be cached or not.
I don't feel super strongly about this though, so could probably be
convinced otherwise...
##########
extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java:
##########
@@ -1157,6 +1161,40 @@ public void testHllEstimateAsVirtualColumnWithTopN()
);
}
+ @SqlTestFrameworkConfig(resultCache = ResultCacheMode.ENABLED)
+ @Test
+ public void testResultCacheWithWindowing()
+ {
+ cannotVectorize();
+ skipVectorize();
+ for (int i = 0; i < 2; i++) {
+ testBuilder()
+ .queryContext(ImmutableMap.of(PlannerContext.CTX_ENABLE_WINDOW_FNS,
true))
+ .sql(
+ "SELECT "
+ + " TIME_FLOOR(__time, 'P1D') as dayLvl,\n"
+ + " dim1,\n"
+ + " HLL_SKETCH_ESTIMATE(DS_HLL(hllsketch_dim1,18,'HLL_4'),
true),\n"
+ + "
HLL_SKETCH_ESTIMATE(DS_HLL(DS_HLL(hllsketch_dim1,18,'HLL_4'),18,'HLL_4') OVER
(PARTITION BY dim1), true),"
+ + " 1\n"
+ + "FROM\n"
+ + " (select * from druid.foo ) ttt\n"
+ + " WHERE __time >= '1903-08-02' AND __time <=
'2033-08-07'\n"
+ + " and dim1 not like '%ikipedia' and l1 > -4\n"
+ + " group by 1,2"
+ )
+ .expectedResults(
+ ImmutableList.of(
+ new Object[] {946684800000L, "", 0.0D, 0.0D, 1},
+ new Object[] {946771200000L, "10.1", 1.0D, 1.0D, 1},
+ new Object[] {946857600000L, "2", 1.0D, 1.0D, 1}
+ )
+ )
+ .run();
+ System.out.println("|sad");
Review Comment:
nit: what is this println for?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]