[GitHub] [metamodel] arjansh commented on a change in pull request #239: METAMODEL-1224: Fixed PostgreSQL compatibility (upgrading driver+tests)

2020-03-24 Thread GitBox
arjansh commented on a change in pull request #239: METAMODEL-1224: Fixed 
PostgreSQL compatibility (upgrading driver+tests)
URL: https://github.com/apache/metamodel/pull/239#discussion_r396963499
 
 

 ##
 File path: core/src/main/java/org/apache/metamodel/query/FromItem.java
 ##
 @@ -222,7 +222,7 @@ public String toStringNoAlias(boolean 
includeSchemaInColumnPaths) {
 }
 StringBuilder sb = new StringBuilder();
 if (_table != null) {
-if (_table.getSchema() != null && _table.getSchema().getName() != 
null) {
+if (_table.getSchema() != null && _table.getSchema().getName() != 
null && !_table.getSchema().getName().isEmpty()) {
 
 Review comment:
   I'm not sure what the code style conventions are for MetaModel, but this 
line is really long. Maybe change it to:
   
   ```
   if (_table.getSchema() != null && _table.getSchema().getName() 
!= null 
   && !_table.getSchema().getName().isEmpty()) {
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [metamodel] arjansh commented on a change in pull request #239: METAMODEL-1224: Fixed PostgreSQL compatibility (upgrading driver+tests)

2020-03-24 Thread GitBox
arjansh commented on a change in pull request #239: METAMODEL-1224: Fixed 
PostgreSQL compatibility (upgrading driver+tests)
URL: https://github.com/apache/metamodel/pull/239#discussion_r396966132
 
 

 ##
 File path: 
jdbc/src/test/java/org/apache/metamodel/jdbc/dialects/PostgresqlQueryRewriterTest.java
 ##
 @@ -46,4 +52,18 @@ public void testInsertNullMap() throws SQLException {
 
 EasyMock.verify(statementMock);
 }
+
+@Test
+public void testApproximateCountQueryAndBlankSchemaName() {
+final SelectItem selectItem = SelectItem.getCountAllItem();
+selectItem.setFunctionApproximationAllowed(true);
+final Query query = new Query();
+query.select(selectItem);
+query.from(new MutableTable("tbl").setSchema(new MutableSchema("")));
+assertEquals("SELECT APPROXIMATE COUNT(*) FROM tbl", query.toSql());
+
 
 Review comment:
   Again, not sure about the code style conventions, but lines 55 and 64 
contain trailing spaces (which for some reason aren't visible in the browser 
view), can you remove these?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services