[
https://issues.apache.org/jira/browse/PHOENIX-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15563705#comment-15563705
]
Eric Lomore commented on PHOENIX-3359:
--------------------------------------
There's a bunch of examples in QueryCompilerTest.java where we want to use
phoenix's query planner.
{code} public void testGroupByOrderPreserving() throws Exception {
Connection conn = DriverManager.getConnection(getUrl());
conn.createStatement().execute("CREATE TABLE t (k1 date not null, k2
date not null, k3 date not null, v varchar, constraint pk primary
key(k1,k2,k3))");
String[] queries = {
"SELECT 1 FROM T GROUP BY k3, (k1,k2)",
"SELECT 1 FROM T GROUP BY k2,k1,k3",
"SELECT 1 FROM T GROUP BY k1,k2",
"SELECT 1 FROM T GROUP BY k1",
"SELECT 1 FROM T GROUP BY CAST(k1 AS TIMESTAMP)",
"SELECT 1 FROM T GROUP BY (k1,k2,k3)",
"SELECT 1 FROM T GROUP BY TRUNC(k2, 'DAY'), CEIL(k1, 'HOUR')",
};
String query;
for (int i = 0; i < queries.length; i++) {
query = queries[i];
QueryPlan plan =
conn.createStatement().unwrap(PhoenixStatement.class).compileQuery(query);
assertTrue("Expected group by to be order preserving: " + query,
plan.getGroupBy().isOrderPreserving());
}
}{code}
> Update JDBC urls to match connection type
> -----------------------------------------
>
> Key: PHOENIX-3359
> URL: https://issues.apache.org/jira/browse/PHOENIX-3359
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Eric Lomore
> Assignee: Eric Lomore
>
> Connection's that are intended to be unwrapped into PhoenixConnection's need
> to be created using the old JDBC url,
> {{DriverManager.getConnection(getOldUrl())}}
> {{PhoenixConnection pc = conn.unwrap(PhoenixConnection.class);}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)