You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by GitBox <gi...@apache.org> on 2021/03/16 12:32:35 UTC

[GitHub] [metamodel] jhorcicka opened a new pull request #250: MM-1235: AbstractDataContext.searchColumn was fixed for situation when schema and column are equal strings

jhorcicka opened a new pull request #250:
URL: https://github.com/apache/metamodel/pull/250


   Fixes https://issues.apache.org/jira/browse/METAMODEL-1235. 
   
   Problem in AbstractDataContext.searchColumn when schema name and column name are equal was fixed.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [metamodel] jhorcicka commented on a change in pull request #250: MM-1235: AbstractDataContext.searchColumn was fixed for situation when schema and column are equal strings

Posted by GitBox <gi...@apache.org>.
jhorcicka commented on a change in pull request #250:
URL: https://github.com/apache/metamodel/pull/250#discussion_r595797516



##########
File path: core/src/main/java/org/apache/metamodel/AbstractDataContext.java
##########
@@ -308,19 +308,17 @@ public final Column getColumnByQualifiedLabel(final String columnName) {
      * @return
      */
     private Column searchColumn(String schemaNameSearch, String columnNameOriginal, String columnNameSearch) {
-        if (columnNameSearch.startsWith(schemaNameSearch)) {
-            Schema schema = getSchemaByName(schemaNameSearch);
-            if (schema != null) {
-                String tableAndColumnPath = columnNameOriginal.substring(schemaNameSearch.length());
-
-                if (tableAndColumnPath.charAt(0) == '.') {
-                    tableAndColumnPath = tableAndColumnPath.substring(1);
-
-                    Column column = getColumn(schema, tableAndColumnPath);
-                    if (column != null) {
-                        return column;
-                    }
-                }
+        final Schema schema = getSchemaByName(schemaNameSearch);
+        if (schema == null) {

Review comment:
       OK




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [metamodel] jhorcicka commented on pull request #250: MM-1235: AbstractDataContext.searchColumn was fixed for situation when schema and column are equal strings

Posted by GitBox <gi...@apache.org>.
jhorcicka commented on pull request #250:
URL: https://github.com/apache/metamodel/pull/250#issuecomment-800902812


   > Can you merge master into this branch and see if Travis then builds successfully?
   
   I did, now it fails with oracle jdk8 only, in Excel module. This seems unrelated.
   
   ![01](https://user-images.githubusercontent.com/13213915/111438598-bc145480-8704-11eb-847b-a7ffa0b3f040.png)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [metamodel] arjansh commented on a change in pull request #250: MM-1235: AbstractDataContext.searchColumn was fixed for situation when schema and column are equal strings

Posted by GitBox <gi...@apache.org>.
arjansh commented on a change in pull request #250:
URL: https://github.com/apache/metamodel/pull/250#discussion_r595214053



##########
File path: core/src/main/java/org/apache/metamodel/AbstractDataContext.java
##########
@@ -308,19 +308,17 @@ public final Column getColumnByQualifiedLabel(final String columnName) {
      * @return
      */
     private Column searchColumn(String schemaNameSearch, String columnNameOriginal, String columnNameSearch) {
-        if (columnNameSearch.startsWith(schemaNameSearch)) {
-            Schema schema = getSchemaByName(schemaNameSearch);
-            if (schema != null) {
-                String tableAndColumnPath = columnNameOriginal.substring(schemaNameSearch.length());
-
-                if (tableAndColumnPath.charAt(0) == '.') {
-                    tableAndColumnPath = tableAndColumnPath.substring(1);
-
-                    Column column = getColumn(schema, tableAndColumnPath);
-                    if (column != null) {
-                        return column;
-                    }
-                }
+        final Schema schema = getSchemaByName(schemaNameSearch);
+        if (schema == null) {

Review comment:
       This method by default returns `null` if it can't find anything. So maybe change this to `if (schema != null) {` here.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [metamodel] arjansh commented on pull request #250: MM-1235: AbstractDataContext.searchColumn was fixed for situation when schema and column are equal strings

Posted by GitBox <gi...@apache.org>.
arjansh commented on pull request #250:
URL: https://github.com/apache/metamodel/pull/250#issuecomment-800945140


   @jhorcicka We forgot to add the last merged PRs related issues to the CHANGES.md, so maybe in the context of this PR, you can also add this to the CHANGES.md:
   
   ```
   ### Apache MetaModel [WIP]
   
    * [METAMODEL-1236] - Elasticsearch: not/empty and is/not null do not work for text based columns
    * [METAMODEL-1235] - Elasticsearch: "String index out of range" when schema name and column name are equal
    * [METAMODEL-1232] - Improve stability of Travis CI builds
   
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [metamodel] asfgit merged pull request #250: MM-1235: AbstractDataContext.searchColumn was fixed for situation when schema and column are equal strings

Posted by GitBox <gi...@apache.org>.
asfgit merged pull request #250:
URL: https://github.com/apache/metamodel/pull/250


   


----------------------------------------------------------------
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:
users@infra.apache.org