[JBoss JIRA] (TEIID-2450) Like criteria with 'Z' before wildcards throw an exception
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2450?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-2450.
-----------------------------------
Fix Version/s: 8.4
Resolution: Done
updated the baseindexinfo to check for case insensitive ordering and generally catching illegalargumentexceptions from obtaining submaps to return empty results rather than an error.
> Like criteria with 'Z' before wildcards throw an exception
> ----------------------------------------------------------
>
> Key: TEIID-2450
> URL: https://issues.jboss.org/browse/TEIID-2450
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.2
> Reporter: Paul Lysak
> Assignee: Steven Hawkins
> Fix For: 8.4
>
>
> If query contains letter 'Z' before wildcard (for example, query contains following part: MY_COLUMN LIKE 'BAZ_BAR') then exception is thrown:
> Caused by: java.lang.IllegalArgumentException: fromKey > toKey
> at java.util.TreeMap$NavigableSubMap.<init>(TreeMap.java:1240)
> ...
> at org.teiid.dqp.internal.process.RecordTable.processQuery(RecordTable.java:189)
> ...
>
> The reason of the problem is following.
> BaseIndexInfo.processCriteria() in order to build "less then" conditon from LIKE increments the code of last character in condition prefix:
> this.addCondition(i, new Constant(prefix.substring(0, prefix.length() -1) + (char) (prefix.charAt(prefix.length()-1)+1)), CompareCriteria.LE);
> If prefix happens to end in uppercase letter 'Z' then after increment it becomes '['.
> But TempMetadataStore uses String.CaseInsensitiveComparator:
> public TempMetadataStore() {
> this(new TreeMap<String, TempMetadataID>(String.CASE_INSENSITIVE_ORDER));
> }
> And String API documentation clearly says that comparison is performed against lowercase versions. Therefore 'Z' is converted to 'z'.
> And later when trying to get subtree with lower bound = 'Z' and upper bound = '[' and exception is thrown because in fact 'z' is lesser then '['
> Other than this exception it also has another problem. If we do query MY_COLUMN LIKE 'BA@_BAR' then upper condition would be 'A' (next character after '@').
> But due to lowercase comparison it will be converted to 'a', so values like 'BAB_BAR', 'BAC_BAR', ... 'BA^_BAR' all would be returned because 'B', 'C', ..., '^' are between '@' and 'a'.
> I suggest either using case sensitive map (with prior conversion of all values to upper case) or converting values in BaseIndexInfo.processCriteria() into lower case.
> I also worry about CompareCriteria.LE in BaseIndexInfo.processCriteria(). Shouldn't it be strictly less? with less or equal when querying 'AAA_' you will get 'AAB_' values as well.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[JBoss JIRA] (TEIID-2450) Like criteria with 'Z' before wildcards throw an exception
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2450?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-2450:
---------------------------------------
Yes there is a regression here with TEIID-2181. However only the exception with the Z case is an issue.
> Other than this exception it also has another problem. If we do query MY_COLUMN LIKE 'BA@_BAR' then upper condition would be 'A' (next character after '@').
But due to lowercase comparison it will be converted to 'a', so values like 'BAB_BAR', 'BAC_BAR', ... 'BA^_BAR' all would be returned because 'B', 'C', ..., '^' are between '@' and 'a'.
That will not happen for two reasons. The first is just as you have stated above that the map comparison will be done using effectively lower case, thus upper B, C, and '^' are not between @ and A. The next is that the predicate will be reevaluated (RecordTable.isValid) to ensure only case sensitive results apply (for example if Ba@ABAR exists it will match the partial index condition, but will not be returned).
I have already confirmed this locally, but if you are not speaking hypothetically here, can you provide a test case that shows bad behavior?
> I also worry about CompareCriteria.LE in BaseIndexInfo.processCriteria(). Shouldn't it be strictly less? with less or equal when querying 'AAA_' you will get 'AAB_' values as well.
The same reasoning as above applies here as well.
> Like criteria with 'Z' before wildcards throw an exception
> ----------------------------------------------------------
>
> Key: TEIID-2450
> URL: https://issues.jboss.org/browse/TEIID-2450
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.2
> Reporter: Paul Lysak
> Assignee: Steven Hawkins
>
> If query contains letter 'Z' before wildcard (for example, query contains following part: MY_COLUMN LIKE 'BAZ_BAR') then exception is thrown:
> Caused by: java.lang.IllegalArgumentException: fromKey > toKey
> at java.util.TreeMap$NavigableSubMap.<init>(TreeMap.java:1240)
> ...
> at org.teiid.dqp.internal.process.RecordTable.processQuery(RecordTable.java:189)
> ...
>
> The reason of the problem is following.
> BaseIndexInfo.processCriteria() in order to build "less then" conditon from LIKE increments the code of last character in condition prefix:
> this.addCondition(i, new Constant(prefix.substring(0, prefix.length() -1) + (char) (prefix.charAt(prefix.length()-1)+1)), CompareCriteria.LE);
> If prefix happens to end in uppercase letter 'Z' then after increment it becomes '['.
> But TempMetadataStore uses String.CaseInsensitiveComparator:
> public TempMetadataStore() {
> this(new TreeMap<String, TempMetadataID>(String.CASE_INSENSITIVE_ORDER));
> }
> And String API documentation clearly says that comparison is performed against lowercase versions. Therefore 'Z' is converted to 'z'.
> And later when trying to get subtree with lower bound = 'Z' and upper bound = '[' and exception is thrown because in fact 'z' is lesser then '['
> Other than this exception it also has another problem. If we do query MY_COLUMN LIKE 'BA@_BAR' then upper condition would be 'A' (next character after '@').
> But due to lowercase comparison it will be converted to 'a', so values like 'BAB_BAR', 'BAC_BAR', ... 'BA^_BAR' all would be returned because 'B', 'C', ..., '^' are between '@' and 'a'.
> I suggest either using case sensitive map (with prior conversion of all values to upper case) or converting values in BaseIndexInfo.processCriteria() into lower case.
> I also worry about CompareCriteria.LE in BaseIndexInfo.processCriteria(). Shouldn't it be strictly less? with less or equal when querying 'AAA_' you will get 'AAB_' values as well.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[JBoss JIRA] (TEIID-2450) Like criteria with 'Z' before wildcards throw an exception
by Paul Lysak (JIRA)
Paul Lysak created TEIID-2450:
---------------------------------
Summary: Like criteria with 'Z' before wildcards throw an exception
Key: TEIID-2450
URL: https://issues.jboss.org/browse/TEIID-2450
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.2
Reporter: Paul Lysak
Assignee: Steven Hawkins
If query contains letter 'Z' before wildcard (for example, query contains following part: MY_COLUMN LIKE 'BAZ_BAR') then exception is thrown:
Caused by: java.lang.IllegalArgumentException: fromKey > toKey
at java.util.TreeMap$NavigableSubMap.<init>(TreeMap.java:1240)
...
at org.teiid.dqp.internal.process.RecordTable.processQuery(RecordTable.java:189)
...
The reason of the problem is following.
BaseIndexInfo.processCriteria() in order to build "less then" conditon from LIKE increments the code of last character in condition prefix:
this.addCondition(i, new Constant(prefix.substring(0, prefix.length() -1) + (char) (prefix.charAt(prefix.length()-1)+1)), CompareCriteria.LE);
If prefix happens to end in uppercase letter 'Z' then after increment it becomes '['.
But TempMetadataStore uses String.CaseInsensitiveComparator:
public TempMetadataStore() {
this(new TreeMap<String, TempMetadataID>(String.CASE_INSENSITIVE_ORDER));
}
And String API documentation clearly says that comparison is performed against lowercase versions. Therefore 'Z' is converted to 'z'.
And later when trying to get subtree with lower bound = 'Z' and upper bound = '[' and exception is thrown because in fact 'z' is lesser then '['
Other than this exception it also has another problem. If we do query MY_COLUMN LIKE 'BA@_BAR' then upper condition would be 'A' (next character after '@').
But due to lowercase comparison it will be converted to 'a', so values like 'BAB_BAR', 'BAC_BAR', ... 'BA^_BAR' all would be returned because 'B', 'C', ..., '^' are between '@' and 'a'.
I suggest either using case sensitive map (with prior conversion of all values to upper case) or converting values in BaseIndexInfo.processCriteria() into lower case.
I also worry about CompareCriteria.LE in BaseIndexInfo.processCriteria(). Shouldn't it be strictly less? with less or equal when querying 'AAA_' you will get 'AAB_' values as well.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[JBoss JIRA] (TEIID-2449) Allow for a vdb zip to store ddl outside of the vdb.xml
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-2449:
-------------------------------------
Summary: Allow for a vdb zip to store ddl outside of the vdb.xml
Key: TEIID-2449
URL: https://issues.jboss.org/browse/TEIID-2449
Project: Teiid
Issue Type: Feature Request
Components: Server
Reporter: Steven Hawkins
Fix For: 8.4
Our current vdb.xml design will include the ddl metadata string in-memory which is not desirable for large metadata sets. We should provide a built-in mechanism to relocate the metadata to separate files in a zip (which can also be a natural replacement for index files when the designer is ready).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[JBoss JIRA] (TEIID-2445) vdb.xml usability enhancements
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2445?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-2445:
----------------------------------
Fix Version/s: 8.4
> vdb.xml usability enhancements
> ------------------------------
>
> Key: TEIID-2445
> URL: https://issues.jboss.org/browse/TEIID-2445
> Project: Teiid
> Issue Type: Enhancement
> Components: Server
> Reporter: Ramesh Reddy
> Assignee: Steven Hawkins
> Fix For: 8.4
>
>
> Couple of usability enhancements need to be done on the -vdb.xml to make the intent clear
> UseConnectorMetadata=true/cached
> - The true case could be removed entirely. The notion of metadata caching could be handled by a model property and should probably be more baked into the MetadataRepository facility (such as passing the cached metadata in for update).
> supports-multi-source-bindings=true/false
> - Since we have mostly removed the binding terminology, it would make more sense to call this just multi-source or multisource (which is consistent with the multisource.columnName and addColumn properties). We could also automatically infer it to be true when there are multiple sources listed for a single model (which is currently an error case without this property) so that it would only be needed if you wanted a single source to appear as if it were a multisource model.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months
[JBoss JIRA] (TEIID-1092) Request to have Global Variables
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-1092?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-1092.
-----------------------------------
Resolution: Done
Added non-transactional session scoped variables accessible via string keys using the teiid_session_get and teiid_session_set system functions. the variables are also accessible via the CommandContext using the getSessionVariable and setSessionVariable methods.
> Request to have Global Variables
> --------------------------------
>
> Key: TEIID-1092
> URL: https://issues.jboss.org/browse/TEIID-1092
> Project: Teiid
> Issue Type: Feature Request
> Components: Server
> Reporter: Debbie Steigner
> Assignee: Steven Hawkins
> Fix For: 8.4
>
>
> Customer is requesting a Global Variable. They want the variable to persist outside of one procedure to other spawned procedures and subsequent queries.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 9 months