[JBoss JIRA] (TEIID-3604) jsontoxml produces wrong result with nested multi-dimensional arrays
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3604?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3604.
-----------------------------------
Resolution: Done
Updated the logic to work below the root as well.
This should be considered for 8.7.x as well.
> jsontoxml produces wrong result with nested multi-dimensional arrays
> --------------------------------------------------------------------
>
> Key: TEIID-3604
> URL: https://issues.jboss.org/browse/TEIID-3604
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.4
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 8.12, 8.11.2
>
>
> A json doc with a multi-dimensional array below the root level will have its elements flattened rather than nested in the xml. For example:
> {foo : [[1,2],[3,4]]}
> is producing 1,2,3,4 as siblings rather than nested as:
> <foo>
> <foo>1</foo>
> <foo>2</foo>
> </foo>
> <foo>
> <foo>3</foo>
> <foo>4</foo>
> </foo>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 4 months
[JBoss JIRA] (TEIID-3598) MongoDB string functions - different handling of NULL values
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-3598?page=com.atlassian.jira.plugin... ]
Ramesh Reddy edited comment on TEIID-3598 at 7/31/15 12:27 PM:
---------------------------------------------------------------
In "substring", the $cond needs to be on the column not the result, then result could be an empty string, so it will NOT work in that situation.
For "toUppper" and "toLower" the expression needs to be like
{code}
{ $cond: [ { $eq: [ $str, ""] }, $str, { $cond: [ { $eq: [ $toLower($str), ""] }, null, $toLower($str) ] } ] }
{code}
was (Author: rareddy):
$cond sould work, good idea.
In "substring", the $cond needs to be on the column not the result, and result could be an empty string, so it will work in that situation.
Even in lower, upper the source string could be empty string, that is another corner case
> MongoDB string functions - different handling of NULL values
> ------------------------------------------------------------
>
> Key: TEIID-3598
> URL: https://issues.jboss.org/browse/TEIID-3598
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Ramesh Reddy
>
> Teiid doesn't handle NULL values right in given functions when working with mongodb.
> * SUBSTRING(<column resolving to NULL>,2)
> ** query:
> {code:sql}
> SELECT INTKEY, STRINGNUM, SUBSTRING(STRINGNUM, 2) FROM BQT1.SmallA ORDER BY INTKEY
> {code}
> ** source query:
> {code:plain}
> {"$project": {{ "c_0" : "$INTKEY" , "c_1" : "$STRINGNUM" , "c_2" : { "$substr" : [ "$STRINGNUM" , { "$subtract" : [ 2 , 1]} , 4000]}}}}
> {code}
> ** problem:
> For row with NULL value in given column returns sth like:
> {code:plain}{ "_id" : ObjectId("534bf17516997a2a41000002"), "c_0" : 1, "c_1" : null, "c_2" : "" }
> {code}which results in "" as result for SUBSTRING(NULL, 2) which should return NULL instead
> * UCASE, LCASE (UPPER, LOWER)
> ** query:
> {code:sql}
> SELECT intkey, stringnum, LOWER(stringnum) AS LOWER FROM BQT1.SmallA ORDER BY intkey
> {code}
> ** source query:
> {code:plain}
> {"$project": {{ "c_0" : "$INTKEY" , "c_1" : "$STRINGNUM" , "c_2" : { "$toLower" : [ "$STRINGNUM"]}}}}
> {code}
> ** problem:
> For row with NULL value in given column returns sth like:
> {code:plain}
> { "_id" : ObjectId("534bf17516997a2a41000002"), "c_0" : 1, "c_1" : null, "c_2" : "" }
> {code} which results in "" as result for LCASE(NULL) which should return NULL instead
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 4 months
[JBoss JIRA] (TEIID-3604) jsontoxml produces wrong result with nested multi-dimensional arrays
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-3604:
-------------------------------------
Summary: jsontoxml produces wrong result with nested multi-dimensional arrays
Key: TEIID-3604
URL: https://issues.jboss.org/browse/TEIID-3604
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.4
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.12, 8.11.2
A json doc with a multi-dimensional array below the root level will have its elements flattened rather than nested in the xml. For example:
{foo : [[1,2],[3,4]]}
is producing 1,2,3,4 as siblings rather than nested as:
<foo>
<foo>1</foo>
<foo>2</foo>
</foo>
<foo>
<foo>3</foo>
<foo>4</foo>
</foo>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 4 months
[JBoss JIRA] (TEIID-3603) missing property key for ERR.015.008.0032
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-3603:
-------------------------------------
Summary: missing property key for ERR.015.008.0032
Key: TEIID-3603
URL: https://issues.jboss.org/browse/TEIID-3603
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.0
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.12
The message for ERR.015.008.0032 is missing. This is the validation that a scalar subquery must project a single column.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 4 months
[JBoss JIRA] (TEIID-3598) MongoDB string functions - different handling of NULL values
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-3598?page=com.atlassian.jira.plugin... ]
Ramesh Reddy edited comment on TEIID-3598 at 7/31/15 11:27 AM:
---------------------------------------------------------------
$cond sould work, good idea.
In "substring", the $cond needs to be on the column not the result, and result could be an empty string, so it will work in that situation.
Even in lower, upper the source string could be empty string, that is another corner case
was (Author: rareddy):
$cond sould work, good idea.
In "substring", the $cond needs to be on the column not the result, and result could be an empty string, so it will work in that situation. Others I will fix the behavior
> MongoDB string functions - different handling of NULL values
> ------------------------------------------------------------
>
> Key: TEIID-3598
> URL: https://issues.jboss.org/browse/TEIID-3598
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Ramesh Reddy
>
> Teiid doesn't handle NULL values right in given functions when working with mongodb.
> * SUBSTRING(<column resolving to NULL>,2)
> ** query:
> {code:sql}
> SELECT INTKEY, STRINGNUM, SUBSTRING(STRINGNUM, 2) FROM BQT1.SmallA ORDER BY INTKEY
> {code}
> ** source query:
> {code:plain}
> {"$project": {{ "c_0" : "$INTKEY" , "c_1" : "$STRINGNUM" , "c_2" : { "$substr" : [ "$STRINGNUM" , { "$subtract" : [ 2 , 1]} , 4000]}}}}
> {code}
> ** problem:
> For row with NULL value in given column returns sth like:
> {code:plain}{ "_id" : ObjectId("534bf17516997a2a41000002"), "c_0" : 1, "c_1" : null, "c_2" : "" }
> {code}which results in "" as result for SUBSTRING(NULL, 2) which should return NULL instead
> * UCASE, LCASE (UPPER, LOWER)
> ** query:
> {code:sql}
> SELECT intkey, stringnum, LOWER(stringnum) AS LOWER FROM BQT1.SmallA ORDER BY intkey
> {code}
> ** source query:
> {code:plain}
> {"$project": {{ "c_0" : "$INTKEY" , "c_1" : "$STRINGNUM" , "c_2" : { "$toLower" : [ "$STRINGNUM"]}}}}
> {code}
> ** problem:
> For row with NULL value in given column returns sth like:
> {code:plain}
> { "_id" : ObjectId("534bf17516997a2a41000002"), "c_0" : 1, "c_1" : null, "c_2" : "" }
> {code} which results in "" as result for LCASE(NULL) which should return NULL instead
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 4 months
[JBoss JIRA] (TEIID-3598) MongoDB string functions - different handling of NULL values
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-3598?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-3598:
-------------------------------------
$cond sould work, good idea.
In "substring", the $cond needs to be on the column not the result, and result could be an empty string, so it will work in that situation. Others I will fix the behavior
> MongoDB string functions - different handling of NULL values
> ------------------------------------------------------------
>
> Key: TEIID-3598
> URL: https://issues.jboss.org/browse/TEIID-3598
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Ramesh Reddy
>
> Teiid doesn't handle NULL values right in given functions when working with mongodb.
> * SUBSTRING(<column resolving to NULL>,2)
> ** query:
> {code:sql}
> SELECT INTKEY, STRINGNUM, SUBSTRING(STRINGNUM, 2) FROM BQT1.SmallA ORDER BY INTKEY
> {code}
> ** source query:
> {code:plain}
> {"$project": {{ "c_0" : "$INTKEY" , "c_1" : "$STRINGNUM" , "c_2" : { "$substr" : [ "$STRINGNUM" , { "$subtract" : [ 2 , 1]} , 4000]}}}}
> {code}
> ** problem:
> For row with NULL value in given column returns sth like:
> {code:plain}{ "_id" : ObjectId("534bf17516997a2a41000002"), "c_0" : 1, "c_1" : null, "c_2" : "" }
> {code}which results in "" as result for SUBSTRING(NULL, 2) which should return NULL instead
> * UCASE, LCASE (UPPER, LOWER)
> ** query:
> {code:sql}
> SELECT intkey, stringnum, LOWER(stringnum) AS LOWER FROM BQT1.SmallA ORDER BY intkey
> {code}
> ** source query:
> {code:plain}
> {"$project": {{ "c_0" : "$INTKEY" , "c_1" : "$STRINGNUM" , "c_2" : { "$toLower" : [ "$STRINGNUM"]}}}}
> {code}
> ** problem:
> For row with NULL value in given column returns sth like:
> {code:plain}
> { "_id" : ObjectId("534bf17516997a2a41000002"), "c_0" : 1, "c_1" : null, "c_2" : "" }
> {code} which results in "" as result for LCASE(NULL) which should return NULL instead
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 4 months