From 1d67e399492e90beebadab76df947492f3a49e97 Mon Sep 17 00:00:00 2001 From: nishantmonu51 Date: Thu, 1 May 2014 21:04:47 +0530 Subject: [PATCH] Fixes fix NPE in select query, calculating cache key remove unwanted logging fix ds in topNQuery --- .../src/main/java/io/druid/indexer/DeterminePartitionsJob.java | 2 -- processing/src/main/java/io/druid/query/UnionDataSource.java | 3 +++ processing/src/main/java/io/druid/query/select/PagingSpec.java | 2 +- processing/src/main/java/io/druid/query/topn/TopNQuery.java | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java b/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java index ddcb691ef09..7a685650528 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java @@ -762,8 +762,6 @@ public class DeterminePartitionsJob implements Jobby log.info(" %s", HadoopDruidIndexerConfig.jsonMapper.writeValueAsString(shardSpec)); } - System.out.println(HadoopDruidIndexerConfig.jsonMapper.writeValueAsString(chosenShardSpecs)); - try { HadoopDruidIndexerConfig.jsonMapper .writerWithType( diff --git a/processing/src/main/java/io/druid/query/UnionDataSource.java b/processing/src/main/java/io/druid/query/UnionDataSource.java index a6034aca7b9..83b9f0acbe7 100644 --- a/processing/src/main/java/io/druid/query/UnionDataSource.java +++ b/processing/src/main/java/io/druid/query/UnionDataSource.java @@ -43,6 +43,9 @@ public class UnionDataSource implements DataSource public UnionDataSource(@JsonProperty("dataSources") List dataSources) { Preconditions.checkNotNull(dataSources, "datasources cannot be null for uniondatasource"); + for(DataSource ds : dataSources){ + Preconditions.checkArgument(ds instanceof TableDataSource, "Union DataSource only supports TableDatasource"); + } this.dataSources = dataSources; } diff --git a/processing/src/main/java/io/druid/query/select/PagingSpec.java b/processing/src/main/java/io/druid/query/select/PagingSpec.java index 7be4cf62746..0ad5b56635d 100644 --- a/processing/src/main/java/io/druid/query/select/PagingSpec.java +++ b/processing/src/main/java/io/druid/query/select/PagingSpec.java @@ -40,7 +40,7 @@ public class PagingSpec @JsonProperty("threshold") int threshold ) { - this.pagingIdentifiers = pagingIdentifiers; + this.pagingIdentifiers = pagingIdentifiers == null ? new LinkedHashMap() : pagingIdentifiers; this.threshold = threshold; } diff --git a/processing/src/main/java/io/druid/query/topn/TopNQuery.java b/processing/src/main/java/io/druid/query/topn/TopNQuery.java index 92e3a18cfa5..b456e487039 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQuery.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQuery.java @@ -167,7 +167,7 @@ public class TopNQuery extends BaseQuery> public Query> withDataSource(DataSource dataSource) { return new TopNQuery( - getDataSource(), + dataSource, dimensionSpec, topNMetricSpec, threshold,