Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/34#discussion_r23278539
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java ---
@@ -98,11 +98,18 @@ public StatementContext(PhoenixStatement statement,
ColumnResolver resolver, Sca
this.aggregates = new AggregationManager();
this.expressions = new ExpressionManager();
PhoenixConnection connection = statement.getConnection();
- this.dateFormat =
connection.getQueryServices().getProps().get(QueryServices.DATE_FORMAT_ATTRIB,
DateUtil.DEFAULT_DATE_FORMAT);
- this.dateFormatTimeZone = TimeZone.getTimeZone(
-
connection.getQueryServices().getProps().get(QueryServices.DATE_FORMAT_TIMEZONE_ATTRIB,
DateUtil.DEFAULT_TIME_ZONE_ID));
+ if (connection!=null) {
--- End diff --
Not crazy about having to do this null check as it may cascade to a lot of
places. You may be able to create a PhoenixConnection from IndexMaintainer if
need be.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---