Search in sources :

Example 16 with JavaScriptConfig

use of org.apache.druid.js.JavaScriptConfig in project druid by druid-io.

the class JavaScriptAggregatorTest method testJavaScriptDisabledFactorizeBuffered.

@Test
public void testJavaScriptDisabledFactorizeBuffered() {
    final JavaScriptAggregatorFactory factory = new JavaScriptAggregatorFactory("foo", ImmutableList.of("foo"), SCRIPT_DOUBLE_SUM.get("fnAggregate"), SCRIPT_DOUBLE_SUM.get("fnReset"), SCRIPT_DOUBLE_SUM.get("fnCombine"), new JavaScriptConfig(false));
    expectedException.expect(IllegalStateException.class);
    expectedException.expectMessage("JavaScript is disabled");
    factory.factorizeBuffered(DUMMY_COLUMN_SELECTOR_FACTORY);
    Assert.assertTrue(false);
}
Also used : JavaScriptConfig(org.apache.druid.js.JavaScriptConfig) Test(org.junit.Test)

Example 17 with JavaScriptConfig

use of org.apache.druid.js.JavaScriptConfig in project druid by druid-io.

the class JavaScriptAggregatorTest method testJavaScriptDisabledFactorize.

@Test
public void testJavaScriptDisabledFactorize() {
    final JavaScriptAggregatorFactory factory = new JavaScriptAggregatorFactory("foo", ImmutableList.of("foo"), SCRIPT_DOUBLE_SUM.get("fnAggregate"), SCRIPT_DOUBLE_SUM.get("fnReset"), SCRIPT_DOUBLE_SUM.get("fnCombine"), new JavaScriptConfig(false));
    expectedException.expect(IllegalStateException.class);
    expectedException.expectMessage("JavaScript is disabled");
    factory.factorize(DUMMY_COLUMN_SELECTOR_FACTORY);
    Assert.assertTrue(false);
}
Also used : JavaScriptConfig(org.apache.druid.js.JavaScriptConfig) Test(org.junit.Test)

Aggregations

JavaScriptConfig (org.apache.druid.js.JavaScriptConfig)17 Test (org.junit.Test)17 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Properties (java.util.Properties)2 DimensionsSpec (org.apache.druid.data.input.impl.DimensionsSpec)2 JavaScriptParseSpec (org.apache.druid.data.input.impl.JavaScriptParseSpec)2 TimestampSpec (org.apache.druid.data.input.impl.TimestampSpec)2 DefaultObjectMapper (org.apache.druid.jackson.DefaultObjectMapper)2 DoubleAnyAggregatorFactory (org.apache.druid.query.aggregation.any.DoubleAnyAggregatorFactory)1 FloatAnyAggregatorFactory (org.apache.druid.query.aggregation.any.FloatAnyAggregatorFactory)1 LongAnyAggregatorFactory (org.apache.druid.query.aggregation.any.LongAnyAggregatorFactory)1 StringAnyAggregatorFactory (org.apache.druid.query.aggregation.any.StringAnyAggregatorFactory)1 CardinalityAggregatorFactory (org.apache.druid.query.aggregation.cardinality.CardinalityAggregatorFactory)1 DoubleFirstAggregatorFactory (org.apache.druid.query.aggregation.first.DoubleFirstAggregatorFactory)1 FloatFirstAggregatorFactory (org.apache.druid.query.aggregation.first.FloatFirstAggregatorFactory)1 LongFirstAggregatorFactory (org.apache.druid.query.aggregation.first.LongFirstAggregatorFactory)1 StringFirstAggregatorFactory (org.apache.druid.query.aggregation.first.StringFirstAggregatorFactory)1 HyperUniquesAggregatorFactory (org.apache.druid.query.aggregation.hyperloglog.HyperUniquesAggregatorFactory)1 DoubleLastAggregatorFactory (org.apache.druid.query.aggregation.last.DoubleLastAggregatorFactory)1 FloatLastAggregatorFactory (org.apache.druid.query.aggregation.last.FloatLastAggregatorFactory)1