Github user LosD commented on a diff in the pull request:
https://github.com/apache/metamodel/pull/74#discussion_r46772077
--- Diff:
jdbc/src/test/java/org/apache/metamodel/jdbc/JdbcDataContextTest.java ---
@@ -261,6 +265,20 @@ public void testWhereScalarFunction() throws Exception
{
}
}
+ public void testUnsupportedAggregateFunction() throws Exception {
+ final Connection connection = getTestDbConnection();
+ final JdbcDataContext dataContext = new
JdbcDataContext(connection);
+ try {
+
dataContext.query().from("customers").select(FunctionType.RANDOM,
"customernumber").execute();
+ fail("Exception expected");
+ } catch (MetaModelException e) {
+ assertEquals(
+ "Aggregate function 'RANDOM' is not supported on this
JDBC database. Query rejected: "
+ + "SELECT
RANDOM(\"CUSTOMERS\".\"CUSTOMERNUMBER\") FROM PUBLIC.\"CUSTOMERS\"",
+ e.getMessage());
+ }
+ }
+
--- End diff --
This is fine, though reformatting the whole file for adding a single
function is a pretty history-destructive.
That much of the formatting is pretty weird doesn't make it better :)
---
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.
---