[JBoss JIRA] (TEIID-4224) HANA translator : incorrect pushdown of DAYOFWEEK function
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4224?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4224:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1339611|https://bugzilla.redhat.com/show_bug.cgi?id=1339611] from NEW to MODIFIED
> HANA translator : incorrect pushdown of DAYOFWEEK function
> ----------------------------------------------------------
>
> Key: TEIID-4224
> URL: https://issues.jboss.org/browse/TEIID-4224
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5, 8.13.5
>
>
> Teiid's DAYOFWEEK function:
> {code:plain}
> DAYOFWEEK(x) Return day of week (Sunday=1, Saturday=7)
> {code}
> is pushed down as:
> {code:plain}
> dayname(g_0."DATEVALUE")
> {code}
> but this function returns string representation of the day.
> More appropriate would be to push DAYOFWEEK as WEEKDAY function, but the returned value has to be adapted to Teiid's representation (Sunday=1 and Saturday=7, vs. HANA's Monday=0,Sunday=6). So the solution would be to push:
> {code:sql}
> MOD((WEEKDAY(datevalue)+1),7)+1
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4226) HANA translator: boolean type converted to tinyint in each convert
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4226?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4226:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1339652|https://bugzilla.redhat.com/show_bug.cgi?id=1339652] from NEW to MODIFIED
> HANA translator: boolean type converted to tinyint in each convert
> ------------------------------------------------------------------
>
> Key: TEIID-4226
> URL: https://issues.jboss.org/browse/TEIID-4226
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.0, 8.12.5, 8.13.5
>
>
> HANA translator blindly converts boolean values to tinyint when a boolean column is pushed as part of a convert function to datasource.
> Example query:
> {code:sql}
> SELECT CONCAT2(stringNum,booleanvalue) FROM BQT1.SmallA;
> {code}
> and its DATA SRC COMMAND:
> {code:sql}
> SELECT CONCAT2(g_0.STRINGNUM, convert(g_0.BOOLEANVALUE, string)) FROM BQT1.SMALLA AS g_0
> {code}
> and its SOURCE SRC COMMAND:
> {code:sql}
> SELECT CASE WHEN g_0."STRINGNUM" IS NULL AND cast(g_0."BOOLEANVALUE" AS tinyint) IS NULL THEN NULL ELSE concat(ifnull(g_0."STRINGNUM", ''), ifnull(cast(g_0."BOOLEANVALUE" AS tinyint), '')) END FROM "BQT1"."SMALLA" AS g_0
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4226) HANA translator: boolean type converted to tinyint in each convert
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4226?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4226.
-----------------------------------
Fix Version/s: 9.0
8.12.5
8.13.5
Resolution: Done
We were missing covering the conversion of boolean to string, which was causing the numeric conversion to be used instead. Now we'll map to true/false as expected.
> HANA translator: boolean type converted to tinyint in each convert
> ------------------------------------------------------------------
>
> Key: TEIID-4226
> URL: https://issues.jboss.org/browse/TEIID-4226
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.0, 8.12.5, 8.13.5
>
>
> HANA translator blindly converts boolean values to tinyint when a boolean column is pushed as part of a convert function to datasource.
> Example query:
> {code:sql}
> SELECT CONCAT2(stringNum,booleanvalue) FROM BQT1.SmallA;
> {code}
> and its DATA SRC COMMAND:
> {code:sql}
> SELECT CONCAT2(g_0.STRINGNUM, convert(g_0.BOOLEANVALUE, string)) FROM BQT1.SMALLA AS g_0
> {code}
> and its SOURCE SRC COMMAND:
> {code:sql}
> SELECT CASE WHEN g_0."STRINGNUM" IS NULL AND cast(g_0."BOOLEANVALUE" AS tinyint) IS NULL THEN NULL ELSE concat(ifnull(g_0."STRINGNUM", ''), ifnull(cast(g_0."BOOLEANVALUE" AS tinyint), '')) END FROM "BQT1"."SMALLA" AS g_0
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4225) HANA translator : DAYNAME function is not pushed
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4225?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4225.
-----------------------------------
Fix Version/s: 9.0
8.12.5
8.13.5
Resolution: Done
While not critical, it was convenient to check this in with other hana issues. The translation accounts for the case difference by using initcap of the lower value.
> HANA translator : DAYNAME function is not pushed
> ------------------------------------------------
>
> Key: TEIID-4225
> URL: https://issues.jboss.org/browse/TEIID-4225
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Priority: Minor
> Fix For: 9.0, 8.12.5, 8.13.5
>
>
> Teiid's DAYNAME function is not being pushed to HANA even though it could be as HANA's DAYNAME function. The only difference could be that HANA returns names in capital letters.
> Query:
> {code:sql}
> SELECT DAYNAME(datevalue) FROM bqt1.smalla
> {code}
> Source specific query:
> {code:sql}
> SELECT g_0."DATEVALUE" FROM "BQT1"."SMALLA" AS g_0
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4224) HANA translator : incorrect pushdown of DAYOFWEEK function
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4224?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4224.
-----------------------------------
Fix Version/s: 9.0
8.12.5
8.13.5
Resolution: Done
Added the translation from above.
> HANA translator : incorrect pushdown of DAYOFWEEK function
> ----------------------------------------------------------
>
> Key: TEIID-4224
> URL: https://issues.jboss.org/browse/TEIID-4224
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5, 8.13.5
>
>
> Teiid's DAYOFWEEK function:
> {code:plain}
> DAYOFWEEK(x) Return day of week (Sunday=1, Saturday=7)
> {code}
> is pushed down as:
> {code:plain}
> dayname(g_0."DATEVALUE")
> {code}
> but this function returns string representation of the day.
> More appropriate would be to push DAYOFWEEK as WEEKDAY function, but the returned value has to be adapted to Teiid's representation (Sunday=1 and Saturday=7, vs. HANA's Monday=0,Sunday=6). So the solution would be to push:
> {code:sql}
> MOD((WEEKDAY(datevalue)+1),7)+1
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4227) Impala Translator - Support Multiple Count Distinct with Group By
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4227?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-4227:
---------------------------------------
Is there a reason you have a full outer join? That will create multiple rows that represent the case when the grouping column is null.
> Impala Translator - Support Multiple Count Distinct with Group By
> -----------------------------------------------------------------
>
> Key: TEIID-4227
> URL: https://issues.jboss.org/browse/TEIID-4227
> Project: Teiid
> Issue Type: Feature Request
> Components: Misc. Connectors
> Affects Versions: 8.13.3
> Reporter: Scott Wallace
> Assignee: Steven Hawkins
>
> This is somewhat related to TEIID-3743, which added support of multiple count distinct metrics. We have a requirement to allow multiple count distinct metrics grouped by common attributes.
> Currently, we get a failure as follows:
> {noformat}org.teiid.runtime.client.TeiidClientException: java.lang.RuntimeException: Remote org.teiid.core.TeiidProcessingException: TEIID30504 vw_impression_click_transaction_process_date_detail: 500051 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.process_date_key, SUM(g_0.num_clicks), SUM(g_0.num_impressions), COUNT(DISTINCT g_0.orderid), COUNT(DISTINCT g_0.`hash_tid`), SUM(g_0.sales) FROM detail.vw_impression_click_transaction_process_date_detail g_0 WHERE g_0.process_date_key >= '2016-05-22' AND g_0.process_date_key < '2016-05-23' AND g_0.advertiser_key = 2149 GROUP BY g_0.process_date_key]
> {noformat}
> To allow this request to succeed, we could have translator write that Impala query as:
> {noformat}
> select nvl(v1.c1,v2.c1), nvl(v1.c2,v1.c2), nvl(v1.c3,v1.c3), v1.c4, v2.c5, nvl(v1.c6,v1.c6) from (
> SELECT g_0.process_date_key as c1,
> SUM(g_0.num_clicks) as c2,
> SUM(g_0.num_impressions) as c3,
> COUNT(DISTINCT g_0.orderid) as c4,
> SUM(g_0.sales) as c6
> FROM detail.vw_impression_click_transaction_process_date_detail g_0
> WHERE g_0.process_date_key >= '2016-05-22'
> AND g_0.process_date_key < '2016-05-23'
> AND g_0.advertiser_key = 2149
> GROUP BY g_0.process_date_key
> ) v1 full outer join
> (
> SELECT g_0.process_date_key as c1,
> SUM(g_0.num_clicks) as c2,
> SUM(g_0.num_impressions) as c3,
> COUNT(DISTINCT g_0.`hash_tid`) as c5,
> SUM(g_0.sales) as c6
> FROM detail.vw_impression_click_transaction_process_date_detail g_0
> WHERE g_0.process_date_key >= '2016-05-22'
> AND g_0.process_date_key < '2016-05-23'
> AND g_0.advertiser_key = 2149
> GROUP BY g_0.process_date_key
> ) v2 on v1.c1 = v2.c1;
> {noformat}
> FYI [~shawkins]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4223) Hana translator: incorrect pushdown of QUARTER function
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4223?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4223.
-----------------------------------
Fix Version/s: 9.0
8.12.5
8.13.5
Resolution: Done
Added an expression to compute the quarter from the month.
> Hana translator: incorrect pushdown of QUARTER function
> -------------------------------------------------------
>
> Key: TEIID-4223
> URL: https://issues.jboss.org/browse/TEIID-4223
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5, 8.13.5
>
>
> Teiid's QUARTER function returns integer.
> SAP HANA's QUARTER function returns string in form:
> {code:plain}
> 2000-Q1
> {code}
> So the function either shouldn't be pushed down, or it has to be pushed down together with some substring method wrapping it:
> {code:sql}
> SUBSTR_REGEXPR('[[:digit:]]{4}\-Q([[:digit:]]{1})' IN quarter(datevalue) GROUP 1)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4221) HANA translator: incorrect pushdown of week function
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4221?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4221:
----------------------------------
Fix Version/s: 8.13.5
> HANA translator: incorrect pushdown of week function
> ----------------------------------------------------
>
> Key: TEIID-4221
> URL: https://issues.jboss.org/browse/TEIID-4221
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5, 8.13.5
>
>
> Hana translator pushes down function week to SAP HANA datasource as its WEEK function. But it is not in accordance with the ISO8601 rule.
> For this standard, HANA has function ISOWEEK, which returns results in following format:
> {code:plain}
> 2000-W01 for date 'Jan 3, 2000'
> {code}
> So it should be possible to push Teiid's WEEK function as:
> {code:sql}
> SUBSTR_REGEXPR('[[:digit:]]{4}\-W([[:digit:]]{2})' IN ISOWEEK(datevalue) GROUP 1)
> {code}
> where 'datevalue' is column of DATE datatype.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months