Skip to content

Commit

Permalink
Update default Presto Pinot Connector Configs
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangfu0 authored and zhenxiao committed Sep 21, 2020
1 parent 14ba79c commit 00fbb9b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 21 deletions.
4 changes: 4 additions & 0 deletions presto-main/etc/catalog/pinot.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connector.name=pinot

# Pinot controller endpoint
pinot.controller-urls=localhost:9000
1 change: 1 addition & 0 deletions presto-main/etc/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ plugin.bundles=\
../presto-sqlserver/pom.xml, \
../presto-postgresql/pom.xml, \
../presto-tpcds/pom.xml, \
../presto-pinot/pom.xml, \
../presto-i18n-functions/pom.xml,\
../presto-function-namespace-managers/pom.xml,\
../presto-druid/pom.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@ public class PinotConfig
private Map<String, String> extraHttpHeaders = ImmutableMap.of();
private Duration metadataCacheExpiry = new Duration(2, TimeUnit.MINUTES);

private boolean allowMultipleAggregations;
private boolean allowMultipleAggregations = true;
private boolean forbidBrokerQueries;
private boolean forbidSegmentQueries;
private boolean inferDateTypeInSchema;
private boolean inferTimestampTypeInSchema;
private boolean markDataFetchExceptionsAsRetriable;
private boolean usePinotSqlForBrokerQueries;

// Infer Pinot time fields to Presto Date/Timestamp type
private boolean inferDateTypeInSchema = true;
private boolean inferTimestampTypeInSchema = true;

// Retry on data fetch exceptions, e.g. timeout from the server side.
private boolean markDataFetchExceptionsAsRetriable = true;

// Requires Pinot version >= 0.4.0.
private boolean usePinotSqlForBrokerQueries = true;

private int numSegmentsPerSplit = 1;
private boolean ignoreEmptyResponses;
private int fetchRetryCount = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ public void testTimeFieldInPinotSchemaToPinotColumns()
public void testConversionWithoutConfigSwitchOn()
{
PinotConfig pinotConfig = new PinotConfig();
pinotConfig.setInferDateTypeInSchema(false);
pinotConfig.setInferTimestampTypeInSchema(false);

// Test Date
Schema testSchema = new Schema.SchemaBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ public void testDefaults()
.setCallerHeaderValue("presto")
.setCallerHeaderParam("RPC-Caller")
.setMetadataCacheExpiry(new Duration(2, TimeUnit.MINUTES))
.setAllowMultipleAggregations(false)
.setInferDateTypeInSchema(false)
.setInferTimestampTypeInSchema(false)
.setAllowMultipleAggregations(true)
.setInferDateTypeInSchema(true)
.setInferTimestampTypeInSchema(true)
.setForbidBrokerQueries(false)
.setUsePinotSqlForBrokerQueries(false)
.setUsePinotSqlForBrokerQueries(true)
.setRestProxyServiceForQuery(null)
.setRestProxyUrl(null)
.setNumSegmentsPerSplit(1)
.setFetchRetryCount(2)
.setMarkDataFetchExceptionsAsRetriable(false)
.setMarkDataFetchExceptionsAsRetriable(true)
.setIgnoreEmptyResponses(false)
.setUseDateTrunc(false)
.setForbidSegmentQueries(false)
Expand All @@ -80,17 +80,17 @@ public void testExplicitPropertyMappings()
.put("pinot.caller-header-value", "myCaller")
.put("pinot.caller-header-param", "myParam")
.put("pinot.service-header-param", "myServiceHeader")
.put("pinot.allow-multiple-aggregations", "true")
.put("pinot.infer-date-type-in-schema", "true")
.put("pinot.infer-timestamp-type-in-schema", "true")
.put("pinot.allow-multiple-aggregations", "false")
.put("pinot.infer-date-type-in-schema", "false")
.put("pinot.infer-timestamp-type-in-schema", "false")
.put("pinot.forbid-broker-queries", "true")
.put("pinot.use-pinot-sql-for-broker-queries", "true")
.put("pinot.use-pinot-sql-for-broker-queries", "false")
.put("pinot.rest-proxy-url", "localhost:1111")
.put("pinot.rest-proxy-service-for-query", "pinot-rest-proxy-service")
.put("pinot.num-segments-per-split", "2")
.put("pinot.ignore-empty-responses", "true")
.put("pinot.fetch-retry-count", "3")
.put("pinot.mark-data-fetch-exceptions-as-retriable", "true")
.put("pinot.mark-data-fetch-exceptions-as-retriable", "false")
.put("pinot.non-aggregate-limit-for-broker-queries", "10")
.put("pinot.use-date-trunc", "true")
.put("pinot.limit-large-for-segment", "100")
Expand All @@ -115,16 +115,16 @@ public void testExplicitPropertyMappings()
.setCallerHeaderValue("myCaller")
.setCallerHeaderParam("myParam")
.setMetadataCacheExpiry(new Duration(1, TimeUnit.MINUTES))
.setAllowMultipleAggregations(true)
.setInferDateTypeInSchema(true)
.setInferTimestampTypeInSchema(true)
.setAllowMultipleAggregations(false)
.setInferDateTypeInSchema(false)
.setInferTimestampTypeInSchema(false)
.setForbidBrokerQueries(true)
.setUsePinotSqlForBrokerQueries(true)
.setUsePinotSqlForBrokerQueries(false)
.setRestProxyServiceForQuery("pinot-rest-proxy-service")
.setNumSegmentsPerSplit(2)
.setIgnoreEmptyResponses(true)
.setFetchRetryCount(3)
.setMarkDataFetchExceptionsAsRetriable(true)
.setMarkDataFetchExceptionsAsRetriable(false)
.setNonAggregateLimitForBrokerQueries(10)
.setLimitLargeForSegment(100)
.setForbidSegmentQueries(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void testMultipleAggregatesWhenAllowed()
@Test(expectedExceptions = NoSuchElementException.class)
public void testMultipleAggregatesNotAllowed()
{
helperTestMultipleAggregatesWithGroupBy(pinotConfig);
helperTestMultipleAggregatesWithGroupBy(new PinotConfig().setAllowMultipleAggregations(false));
}

protected void helperTestMultipleAggregatesWithGroupBy(PinotConfig givenPinotConfig)
Expand Down

0 comments on commit 00fbb9b

Please sign in to comment.