From 035986b3bc7afeacbdabe63d32a75862a29074d1 Mon Sep 17 00:00:00 2001 From: xvrl Date: Tue, 5 Mar 2013 11:45:51 -0800 Subject: [PATCH] keep track of queried fields --- .../src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 b/client/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 index 1db68267f22..f0bf7d02f90 100644 --- a/client/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 +++ b/client/src/main/antlr4/com/metamx/druid/sql/antlr4/DruidSQL.g4 @@ -20,6 +20,7 @@ import java.util.*; public List postAggregators = new LinkedList(); public DimFilter filter; public List intervals; + public List fields = new LinkedList(); public QueryGranularity granularity = QueryGranularity.ALL; public Map groupByDimensions = new LinkedHashMap(); @@ -116,7 +117,10 @@ query select_stmt : 'select' e+=aliasedExpression (',' e+=aliasedExpression)* 'from' datasource { - for(AliasedExpressionContext a : $e) { postAggregators.add(a.p); } + for(AliasedExpressionContext a : $e) { + postAggregators.add(a.p); + fields.add(a.p.getName()); + } this.dataSourceName = $datasource.text; } ;