[JBoss JIRA] (TEIID-3937) Multiplying two columns in CASE statement overrides pushdown (Impala)
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3937?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-3937.
---------------------------------
> Multiplying two columns in CASE statement overrides pushdown (Impala)
> ---------------------------------------------------------------------
>
> Key: TEIID-3937
> URL: https://issues.jboss.org/browse/TEIID-3937
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.4
> Environment: Ubuntu Trusty
> Reporter: Don Krapohl
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5
>
>
> In the Impala translator, pushdown doesn't happen when two columns are multiplied in the THEN portion of a CASE statement with decimal data type.
> //this should push down but does not
> CASE WHEN column1 IS NOT NULL
> THEN column1 * column2
> ELSE column3 END
> //but you can multiply the columns by a constant and it will push down
> CASE WHEN column1 IS NOT NULL
> THEN column1 * 34567
> ELSE column3 END
> //or
> CASE WHEN column1 IS NOT NULL
> THEN 34567 * column2
> ELSE column3 END
> //or casting to consistent datatypes with DECIMAL output
> CASE WHEN column1 IS NOT NULL
> THEN cast(column1 as DECIMAL ) * cast(column2 as DECIMAL )
> ELSE cast(column3 as DECIMAL ) END
> //BUT output it as double with the cast statement above changed and it does push down (so floating point works)
> CASE WHEN column1 IS NOT NULL
> THEN cast(column1 as double ) * cast(column2 as double)
> ELSE cast(column3 as double) END
> Source data types:
> Column1 is DECIMAL
> Column2 is BIGINT/LONG
> Column3 is DECIMAL
> Output column is DECIMAL
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 9 months
[JBoss JIRA] (TEIID-3748) Impala translator - SELECT and HAVING statements are translating differently for Case statements
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3748?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-3748.
---------------------------------
> Impala translator - SELECT and HAVING statements are translating differently for Case statements
> ------------------------------------------------------------------------------------------------
>
> Key: TEIID-3748
> URL: https://issues.jboss.org/browse/TEIID-3748
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.11.4
> Environment: Ubuntu Trusty
> Reporter: Don Krapohl
> Assignee: Steven Hawkins
> Labels: Impala_Translator, Translators
> Fix For: 9.0, 8.12.5, 8.13.1
>
> Attachments: server.log
>
>
> Error from Impala-
> all DISTINCT aggregate functions need to have the same set of parameters as count(DISTINCT (CASE WHEN (secondcol >= 0) THEN 1 ELSE CAST(NULL AS STRING) END))
> deviating function: count(DISTINCT (CASE WHEN (secondcol >= 0) THEN 1 ELSE NULL END))
> Query:
> SELECT user_key, sum(firstcol),count(distinct case when secondcol >= 0 then 1 end)
> FROM sometable
> WHERE customer_key=6
> GROUP BY user_key
> HAVING sum(firstcol)>100
> AND count(distinct case when secondcol >= 0 then 1 end)=0
>
> Query explanation:
> For all users
> Add up values in the firstcol column (integer column)
> count distinct values in secondcol where secondcol value zero or more
> otherwise return null (output is string)
> Translated Teiid query:
> SELECT user_key, SUM(firstcol) as `EXPR_0`, COUNT(DISTINCT (CASE WHEN (secondcol >= 0) THEN '1' ELSE CAST(NULL AS STRING) END)) as `EXPR_1`
> FROM sometable
> WHERE customer_key` = 6
> HAVING (EXPR_0 > 100) AND (COUNT(DISTINCT (CASE WHEN (secondcol >= 0) THEN '1' ELSE NULL END)) = 0))
> Note the difference between the select and having for EXPR_1:
> Select - THEN '1' ELSE CAST(NULL AS STRING) END
> Having - THEN '1' ELSE NULL END
> Impala doesn't accept that these are the same aggregate function. Aliases aren't accepted in the HAVING.
> One further observation- if we swap the translation and write the statement in the select as
> COUNT(DISTINCT (CASE WHEN (secondcol >= 0) THEN '1' *ELSE NULL END*))
> Teiid translates the SELECT to
> COUNT(DISTINCT (CASE WHEN (secondcol >= 0) THEN '1' *ELSE CAST(NULL AS STRING) END*))
> So it always makes these mismatched.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 9 months
[JBoss JIRA] (TEIID-3993) Teiid: indexOutOfBoundsException on union + count distinct query
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3993?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-3993.
---------------------------------
> Teiid: indexOutOfBoundsException on union + count distinct query
> -----------------------------------------------------------------
>
> Key: TEIID-3993
> URL: https://issues.jboss.org/browse/TEIID-3993
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.3
> Environment: Teiid 8.12.3 + posgtesDB
> Reporter: Ivan Chan
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5, 8.13.2
>
> Attachments: teiid_debug.txt, teiid_stack.txt
>
>
> I ran into IndexOfBoundsException from teiid query optimizer when running the following query:
> select "SugarCRMDataSource_public_sales_location"."country" as "SugarCRMDataSource_public_sales_location_country",
> "FoodmartDataSource_public_store"."store_country" as "FoodmartDataSource_public_store_store_country",
> '1|1' as "JS_Discriminator_COL",
> count(DISTINCT "SugarCRMDataSource_public_sales_fact"."amount") as "CountDistinct_SugarCRMDataSource_public_sales_fact_amount"
> from "SugarCRMDataSource_public"."sales_fact" "SugarCRMDataSource_public_sales_fact"
> inner join "SugarCRMDataSource_public"."sales_location" "SugarCRMDataSource_public_sales_location" on ("SugarCRMDataSource_public_sales_fact"."sales_location_id" = "SugarCRMDataSource_public_sales_location"."id")
> inner join "FoodmartDataSource_public"."store" "FoodmartDataSource_public_store" on ("SugarCRMDataSource_public_sales_location"."state" = "FoodmartDataSource_public_store"."store_state")
> group by "SugarCRMDataSource_public_sales_location"."country", "FoodmartDataSource_public_store"."store_country"
> UNION ALL
> select "SugarCRMDataSource_public_sales_location"."country" as "SugarCRMDataSource_public_sales_location_country",
> NULL as "FoodmartDataSource_public_store_store_country",
> '1|0' as "JS_Discriminator_COL",
> count(DISTINCT "SugarCRMDataSource_public_sales_fact"."amount") as "CountDistinct_SugarCRMDataSource_public_sales_fact_amount"
> from "SugarCRMDataSource_public"."sales_fact" "SugarCRMDataSource_public_sales_fact"
> inner join "SugarCRMDataSource_public"."sales_location" "SugarCRMDataSource_public_sales_location" on ("SugarCRMDataSource_public_sales_fact"."sales_location_id" = "SugarCRMDataSource_public_sales_location"."id")
> inner join "FoodmartDataSource_public"."store" "FoodmartDataSource_public_store" on ("SugarCRMDataSource_public_sales_location"."state" = "FoodmartDataSource_public_store"."store_state")
> group by "SugarCRMDataSource_public_sales_location"."country"
> UNION ALL
> select NULL as "SugarCRMDataSource_public_sales_location_country",
> "FoodmartDataSource_public_store"."store_country" as "FoodmartDataSource_public_store_store_country",
> '0|1' as "JS_Discriminator_COL",
> count(DISTINCT "SugarCRMDataSource_public_sales_fact"."amount") as "CountDistinct_SugarCRMDataSource_public_sales_fact_amount"
> from "SugarCRMDataSource_public"."sales_fact" "SugarCRMDataSource_public_sales_fact"
> inner join "SugarCRMDataSource_public"."sales_location" "SugarCRMDataSource_public_sales_location" on ("SugarCRMDataSource_public_sales_fact"."sales_location_id" = "SugarCRMDataSource_public_sales_location"."id")
> inner join "FoodmartDataSource_public"."store" "FoodmartDataSource_public_store" on ("SugarCRMDataSource_public_sales_location"."state" = "FoodmartDataSource_public_store"."store_state")
> group by "FoodmartDataSource_public_store"."store_country"
> UNION ALL
> select NULL as "SugarCRMDataSource_public_sales_location_country",
> NULL as "FoodmartDataSource_public_store_store_country",
> '0|0' as "JS_Discriminator_COL",
> count(DISTINCT "SugarCRMDataSource_public_sales_fact"."amount") as "CountDistinct_SugarCRMDataSource_public_sales_fact_amount"
> from "SugarCRMDataSource_public"."sales_fact" "SugarCRMDataSource_public_sales_fact"
> inner join "SugarCRMDataSource_public"."sales_location" "SugarCRMDataSource_public_sales_location" on ("SugarCRMDataSource_public_sales_fact"."sales_location_id" = "SugarCRMDataSource_public_sales_location"."id")
> inner join "FoodmartDataSource_public"."store" "FoodmartDataSource_public_store" on ("SugarCRMDataSource_public_sales_location"."state" = "FoodmartDataSource_public_store"."store_state")
> order by "SugarCRMDataSource_public_sales_location_country", "FoodmartDataSource_public_store_store_country"
> limit 1000
> And here is the exception:
> Caused by: java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
> at java.util.ArrayList.rangeCheck(ArrayList.java:635)
> at java.util.ArrayList.get(ArrayList.java:411)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.setColStatEstimates(NewCalculateCostUtil.java:411)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.setCardinalityEstimate(NewCalculateCostUtil.java:313)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.estimateSetOpCost(NewCalculateCostUtil.java:252)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.computeNodeCost(NewCalculateCostUtil.java:204)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.updateCardinality(NewCalculateCostUtil.java:136)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.updateCardinality(NewCalculateCostUtil.java:133)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.updateCardinality(NewCalculateCostUtil.java:133)
> at org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil.computeCostForTree(NewCalculateCostUtil.java:122)
> at org.teiid.query.optimizer.relational.rules.RuleCalculateCost.execute(RuleCalculateCost.java:50)
> at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:807)
> at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:223)
> at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:159)
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:435)
> at org.teiid.dqp.internal.process.PreparedStatementRequest.generatePlan(PreparedStatementRequest.java:119)
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:463)
> at org.teiid.dqp.internal.process.PreparedStatementRequest.processRequest(PreparedStatementRequest.java:294)
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:640)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:337)
> ... 22 more
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 9 months
[JBoss JIRA] (TEIID-4011) automatic/autonomous refresh of materialized views does not work
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4011?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-4011.
---------------------------------
> automatic/autonomous refresh of materialized views does not work
> ----------------------------------------------------------------
>
> Key: TEIID-4011
> URL: https://issues.jboss.org/browse/TEIID-4011
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.3
> Reporter: Marco Ardito
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5, 8.13.2
>
>
> configuring a materialized view (snapshot) to be automatically refreshed/reloaded does not happen, even with option "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" true.
> (see forum reference for full vdb details)
> server log reports:
> WARN [org.teiid.PROCESSOR] (Worker110_QueryProcessorQueue3121) KbqgRXX20t5r TEIID30020 Processing exception for request KbqgRXX20t5r.0 'TEIID31100 Parsing error: Encountered "[*]SYSADMIN.refreshMatView[*](\"views\".\"dati_mat\"" at line 1, column 1.
> Was expecting: "alter" | "begin" | "call" | "create" | "delete" | "drop" | "exec" | "execute" | "insert" | "merge" ...'. Originally QueryParserException QueryParser.java:214. Enable more detailed logging to see the entire stacktrace.
> since the view has a ttl of 120000 the above log appears every two minutes.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 9 months
[JBoss JIRA] (TEIID-4004) Teiid teiid-web-security project can't be built
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4004?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-4004.
---------------------------------
> Teiid teiid-web-security project can't be built
> -----------------------------------------------
>
> Key: TEIID-4004
> URL: https://issues.jboss.org/browse/TEIID-4004
> Project: Teiid
> Issue Type: Bug
> Components: Tools
> Reporter: Jan Stastny
> Assignee: Jan Stastny
>
> The project used to build custom OData WAR with different security profiles can't be compiled in maven.
> The problem is caused by its module database-service, which is located in ./examples/database-service/pom.xml. Maven complains, that it can't find artifact odata-web-parent, which is the parent project here.
> It can be resolved by specifying <relativePath>../../pom.xml</relativePath> in the database-service jar's pom.xml
> {code:plain}
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project org.jboss.teiid:database-service:[unknown-version] (/home/jstastny/gitrepo/teiid-web-security/examples/database-service/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for org.jboss.teiid:database-service:[unknown-version]: Failure to find org.jboss.teiid:odata-web-parent:pom:0.0.1-SNAPSHOT in http://dvqe11.mw.lab.eng.bos.redhat.com:8081/nexus/content/repositories/r... was cached in the local repository, resolution will not be reattempted until the update interval of nexus-releases has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 9 months