[JBoss JIRA] (TEIID-3813) Informix translator - convert function in definition of view is not pushed down
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3813?page=com.atlassian.jira.plugin... ]
Steven Hawkins edited comment on TEIID-3813 at 11/10/15 3:36 PM:
-----------------------------------------------------------------
Updated the informix translator to support cast using their relevant type names and standard cast syntax - more than like this is valid for only informix 9 or later. Version 8 may need to use the older pg :: style cast - and version 7 does not appear to support casting.
was (Author: shawkins):
Updated the informix translator to support cast using their relevant type names and standard cast syntax - more than like this is valid for only informix 9.
> Informix translator - convert function in definition of view is not pushed down
> -------------------------------------------------------------------------------
>
> Key: TEIID-3813
> URL: https://issues.jboss.org/browse/TEIID-3813
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.7.1.6_2
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Fix For: 8.12.2, 8.13
>
>
> I defined a view (see definition below). When I try to select all rows from the view, teiid/informix jdbc driver throws an exception.
> Teiid DDL:
> {code:sql}
> CREATE VIEW U6 (StringCol string,
> IntCol integer)
> AS
> SELECT CONVERT(BQT1.SmallA.IntNum, string) AS StringCol, BQT1.SmallA.IntNum AS IntCol
> FROM BQT1.SmallA
> UNION ALL
> SELECT BQT1.SmallB.StringNum, CONVERT(BQT1.SmallB.StringNum, integer)
> FROM BQT1.SmallB;
> }
> {code}
> Query:
> {code:sql}
> SELECT * FROM VQT.U6
> {code}
> Source-specific query
> {code:sql}
> SELECT g_1.intnum AS c_0, g_1.intnum AS c_1 FROM smalla AS g_1 UNION ALL SELECT g_0.stringnum AS c_0, g_0.stringnum AS c_1 FROM smallb AS g_0
> {code}
> Actual exception:
> {code:text}
> Caused by: java.sql.SQLException: The statement failed because corresponding column data types must be compatible for each UNION, INTERSECT, or MINUS query.
> at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408)
> at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3178)
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 1 month
[JBoss JIRA] (TEIID-3813) Informix translator - convert function in definition of view is not pushed down
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3813?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3813.
-----------------------------------
Fix Version/s: 8.12.2
8.13
Resolution: Done
Updated the informix translator to support cast using their relevant type names and standard cast syntax - more than like this is valid for only informix 9.
> Informix translator - convert function in definition of view is not pushed down
> -------------------------------------------------------------------------------
>
> Key: TEIID-3813
> URL: https://issues.jboss.org/browse/TEIID-3813
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.7.1.6_2
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Fix For: 8.12.2, 8.13
>
>
> I defined a view (see definition below). When I try to select all rows from the view, teiid/informix jdbc driver throws an exception.
> Teiid DDL:
> {code:sql}
> CREATE VIEW U6 (StringCol string,
> IntCol integer)
> AS
> SELECT CONVERT(BQT1.SmallA.IntNum, string) AS StringCol, BQT1.SmallA.IntNum AS IntCol
> FROM BQT1.SmallA
> UNION ALL
> SELECT BQT1.SmallB.StringNum, CONVERT(BQT1.SmallB.StringNum, integer)
> FROM BQT1.SmallB;
> }
> {code}
> Query:
> {code:sql}
> SELECT * FROM VQT.U6
> {code}
> Source-specific query
> {code:sql}
> SELECT g_1.intnum AS c_0, g_1.intnum AS c_1 FROM smalla AS g_1 UNION ALL SELECT g_0.stringnum AS c_0, g_0.stringnum AS c_1 FROM smallb AS g_0
> {code}
> Actual exception:
> {code:text}
> Caused by: java.sql.SQLException: The statement failed because corresponding column data types must be compatible for each UNION, INTERSECT, or MINUS query.
> at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408)
> at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3178)
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 1 month
[JBoss JIRA] (TEIID-3813) Informix translator - convert function in definition of view is not pushed down
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3813?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-3813:
----------------------------------
Component/s: JDBC Connector
> Informix translator - convert function in definition of view is not pushed down
> -------------------------------------------------------------------------------
>
> Key: TEIID-3813
> URL: https://issues.jboss.org/browse/TEIID-3813
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.7.1.6_2
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
>
> I defined a view (see definition below). When I try to select all rows from the view, teiid/informix jdbc driver throws an exception.
> Teiid DDL:
> {code:sql}
> CREATE VIEW U6 (StringCol string,
> IntCol integer)
> AS
> SELECT CONVERT(BQT1.SmallA.IntNum, string) AS StringCol, BQT1.SmallA.IntNum AS IntCol
> FROM BQT1.SmallA
> UNION ALL
> SELECT BQT1.SmallB.StringNum, CONVERT(BQT1.SmallB.StringNum, integer)
> FROM BQT1.SmallB;
> }
> {code}
> Query:
> {code:sql}
> SELECT * FROM VQT.U6
> {code}
> Source-specific query
> {code:sql}
> SELECT g_1.intnum AS c_0, g_1.intnum AS c_1 FROM smalla AS g_1 UNION ALL SELECT g_0.stringnum AS c_0, g_0.stringnum AS c_1 FROM smallb AS g_0
> {code}
> Actual exception:
> {code:text}
> Caused by: java.sql.SQLException: The statement failed because corresponding column data types must be compatible for each UNION, INTERSECT, or MINUS query.
> at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408)
> at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3178)
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 1 month
[JBoss JIRA] (TEIID-3812) HANA MIN and MAX functions not applicable on boolean
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3812?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3812.
-----------------------------------
Fix Version/s: 8.12.2
8.13
Resolution: Done
Changed to compute the min/max by casting to tinyint and then converting the expression back to boolean.
> HANA MIN and MAX functions not applicable on boolean
> ----------------------------------------------------
>
> Key: TEIID-3812
> URL: https://issues.jboss.org/browse/TEIID-3812
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 8.12.2, 8.13
>
>
> SAP HANA doesn't support MIN and MAX functions for BOOLEAN type.
> Compared to postgresql, which also has BOOLEAN data type, it seems inconsistent, as postgresql translator mimics MIN and MAX functions by translating them using PostgreSQL specific constructs:
> min(BooleanValue) as bool_and(BooleanValue)
> max(BooleanValue) as bool_or(BooleanValue)
> Similar issue is with CEILING and FLOOR functions.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 1 month
[JBoss JIRA] (TEIID-3802) HANA translator modifies boolean to tinyint in type conversion
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-3802?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-3802:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1278409|https://bugzilla.redhat.com/show_bug.cgi?id=1278409] from NEW to MODIFIED
> HANA translator modifies boolean to tinyint in type conversion
> --------------------------------------------------------------
>
> Key: TEIID-3802
> URL: https://issues.jboss.org/browse/TEIID-3802
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 8.12.2, 8.13
>
>
> Teiid modifies boolean data type to tinyint before pushing the query down to the HANA instance.
> This brings following issue while having a query similar to this one:
> {code:sql}
> SELECT BQT1.SMallA.BooleanValue,cast(BQT2.SmallB.CharValue as boolean) FROM BQT1.SmallA,BQT2.SmallB WHERE BQT1.SmallA.BooleanValue = cast(BQT2.SmallB.CharValue as boolean)
> {code}
> which Teiid modifies to:
> {code:sql}
> SELECT g_0."BOOLEANVALUE", cast(g_1."CHARVALUE" AS tinyint) FROM "BQT1"."SMALLA" AS g_0, "BQT2"."SMALLB" AS g_1 WHERE g_0."BOOLEANVALUE" = cast(g_1."CHARVALUE" AS tinyint)
> {code}
> But the problem is not present for:
> {code:sql}
> SELECT BQT1.SMallA.BooleanValue FROM BQT1.SmallA WHERE BQT1.SmallA.BooleanValue = cast(BQT1.SmallA.CharValue as boolean)
> {code}
> It seems that the Cartesian product and comparing values from different sources are the cause of the issue. But HANA has internal type BOOLEAN, so there might be no point at modifying the type to TINYINT after all. I also checked, that the pushed query (which causes the issue) with the casting altered to BOOLEAN runs well on HANA. The following query returns expected results when pushed directly to HANA instance:
> {code:sql}
> SELECT g_0."BOOLEANVALUE", cast(g_1."CHARVALUE" AS boolean) FROM "BQT1"."SMALLA" AS g_0, "BQT2"."SMALLB" AS g_1 WHERE g_0."BOOLEANVALUE" = cast(g_1."CHARVALUE" AS boolean)
> {code}
> NOTE: The CharValue columns are modelled as VARCHAR/string in fact. Thus the cast is a valid operation.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 1 month
[JBoss JIRA] (TEIID-3802) HANA translator modifies boolean to tinyint in type conversion
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3802?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3802.
-----------------------------------
Fix Version/s: 8.12.2
8.13
Assignee: Steven Hawkins (was: Ted Jones)
Resolution: Done
Opted to just cast to boolean - if we need to support an older version of hana without a boolean type, then we can restrict the pushdown at that time.
> HANA translator modifies boolean to tinyint in type conversion
> --------------------------------------------------------------
>
> Key: TEIID-3802
> URL: https://issues.jboss.org/browse/TEIID-3802
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 8.12.2, 8.13
>
>
> Teiid modifies boolean data type to tinyint before pushing the query down to the HANA instance.
> This brings following issue while having a query similar to this one:
> {code:sql}
> SELECT BQT1.SMallA.BooleanValue,cast(BQT2.SmallB.CharValue as boolean) FROM BQT1.SmallA,BQT2.SmallB WHERE BQT1.SmallA.BooleanValue = cast(BQT2.SmallB.CharValue as boolean)
> {code}
> which Teiid modifies to:
> {code:sql}
> SELECT g_0."BOOLEANVALUE", cast(g_1."CHARVALUE" AS tinyint) FROM "BQT1"."SMALLA" AS g_0, "BQT2"."SMALLB" AS g_1 WHERE g_0."BOOLEANVALUE" = cast(g_1."CHARVALUE" AS tinyint)
> {code}
> But the problem is not present for:
> {code:sql}
> SELECT BQT1.SMallA.BooleanValue FROM BQT1.SmallA WHERE BQT1.SmallA.BooleanValue = cast(BQT1.SmallA.CharValue as boolean)
> {code}
> It seems that the Cartesian product and comparing values from different sources are the cause of the issue. But HANA has internal type BOOLEAN, so there might be no point at modifying the type to TINYINT after all. I also checked, that the pushed query (which causes the issue) with the casting altered to BOOLEAN runs well on HANA. The following query returns expected results when pushed directly to HANA instance:
> {code:sql}
> SELECT g_0."BOOLEANVALUE", cast(g_1."CHARVALUE" AS boolean) FROM "BQT1"."SMALLA" AS g_0, "BQT2"."SMALLB" AS g_1 WHERE g_0."BOOLEANVALUE" = cast(g_1."CHARVALUE" AS boolean)
> {code}
> NOTE: The CharValue columns are modelled as VARCHAR/string in fact. Thus the cast is a valid operation.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 1 month
[JBoss JIRA] (TEIID-3817) HANA FLOOR and CELING functions not applicable to boolean
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3817?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3817.
-----------------------------------
Fix Version/s: 8.12.2
8.13
Resolution: Done
Added a general cast to tinyint to prevent issues with non-integral types.
> HANA FLOOR and CELING functions not applicable to boolean
> ---------------------------------------------------------
>
> Key: TEIID-3817
> URL: https://issues.jboss.org/browse/TEIID-3817
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 8.12.2, 8.13
>
>
> SAP HANA doesn't support FLOOR and CEILING functions for BOOLEAN type.
> Compared to postgresql, which also has BOOLEAN data type, it seems inconsistent.
> When querying postgres directly:
> {code:sql}
> SELECT CEILING(BooleanValue) FROM BQT1.SmallA
> {code}
> is not valid query.
> But through Teiid, it returns double values corresponding to the boolean value provided:
> 0.0 for CEILING(false)
> 1.0 for CELING(true)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 1 month