jihoonson commented on a change in pull request #6902: sql, filters, and virtual columns URL: https://github.com/apache/incubator-druid/pull/6902#discussion_r258306664
########## File path: extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/filter/sql/BloomDimFilterSqlTest.java ########## @@ -165,11 +166,41 @@ public void testBloomFilterVirtualColumn() throws Exception ); } + @Test + public void testBloomFilterVirtualColumn() throws Exception + { + BloomKFilter filter = new BloomKFilter(1500); + filter.addString("def-foo"); + byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); + String base64 = StringUtils.encodeBase64String(bytes); + + testQuery( + StringUtils.format("SELECT COUNT(*) FROM druid.foo WHERE bloom_filter_test(concat(dim1, '-foo'), '%s')", base64), + ImmutableList.of( + Druids.newTimeseriesQueryBuilder() + .dataSource(CalciteTests.DATASOURCE1) + .intervals(QSS(Filtration.eternity())) + .granularity(Granularities.ALL) + .virtualColumns(EXPRESSION_VIRTUAL_COLUMN("v0", "concat(\"dim1\",'-foo')", ValueType.STRING)) + .filters( + new BloomDimFilter("v0", BloomKFilterHolder.fromBloomKFilter(filter), null) + ) + .aggregators(AGGS(new CountAggregatorFactory("a0"))) + .context(TIMESERIES_CONTEXT_DEFAULT) + .build() + ), + ImmutableList.of( + new Object[]{1L} + ) + ); + } + + @Test public void testBloomFilterVirtualColumnNumber() throws Exception { BloomKFilter filter = new BloomKFilter(1500); - filter.addDouble(20.2); + filter.addFloat(20.2f); Review comment: Would you tell me why this change is needed? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org