[JBoss JIRA] (TEIID-3785) PostgreSQL - Large Objects may not be used in auto-commit mode.
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3785?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-3785.
---------------------------------
> PostgreSQL - Large Objects may not be used in auto-commit mode.
> ---------------------------------------------------------------
>
> Key: TEIID-3785
> URL: https://issues.jboss.org/browse/TEIID-3785
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.11.3, 8.11.5
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Fix For: 8.12.1, 8.13
>
> Attachments: cola_markets.sql, cola_mkt.gif, Spatial-vdb.xml
>
>
> Using Teiid 8.11.5 with PostgreSQL 9.4 and PostGIS. Doing a simple query with a spatial filter causes this stacktrace in the log.
> {code}
> select mkt_id from cola_markets where st_intersects(shape, st_geomfromtext('point(9 8)'));
> {code}
> {code}
> 20:29:06,694 WARN [org.teiid.CONNECTOR] (Worker3_QueryProcessorQueue72) uL81ZQ6FDlJL Connector worker process failed for atomic-request=uL81ZQ6FDlJL.22.0.8: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: ['javax.sql.rowset.serial.SerialBlob@223261cf'] SQL: SELECT g_0."mkt_id" FROM "public"."cola_markets" AS g_0 WHERE st_intersects(g_0."shape", st_geomfromwkb(?, 0)) = TRUE]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.11.5.jar:8.11.5]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:341)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_79]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_79]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_79]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_79]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy46.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_79]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
> Caused by: org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode.
> at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:239)
> at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:226)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setBlob(AbstractJdbc2Statement.java:3048)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1836)
> at org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3Statement.java:1481)
> at org.postgresql.jdbc3g.AbstractJdbc3gStatement.setObject(AbstractJdbc3gStatement.java:46)
> at org.postgresql.jdbc4.AbstractJdbc4Statement.setObject(AbstractJdbc4Statement.java:70)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1868)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:957)
> at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:936) [translator-jdbc-8.11.5.jar:8.11.5]
> at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107) [translator-jdbc-8.11.5.jar:8.11.5]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:122) [translator-jdbc-8.11.5.jar:8.11.5]
> ... 18 more
> 20:29:06,720 WARN [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue73) uL81ZQ6FDlJL TEIID30020 Processing exception for request uL81ZQ6FDlJL.22 'TEIID30504 postgres: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: ['javax.sql.rowset.serial.SerialBlob@223261cf'] SQL: SELECT g_0."mkt_id" FROM "public"."cola_markets" AS g_0 WHERE st_intersects(g_0."shape", st_geomfromwkb(?, 0)) = TRUE]'. Originally TeiidProcessingException 'Large Objects may not be used in auto-commit mode.' LargeObjectManager.java:239. Enable more detailed logging to see the entire stacktrace.
> {code}
> It looks like the issue is binding the WKB blob. Overriding the PostgreSQL translator and setting {{useStreamsForLobs()}} to {{true}} seems to fix the issue.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (TEIID-3937) Multiplying two columns in CASE statement overrides pushdown (Impala)
by Don Krapohl (JIRA)
[ https://issues.jboss.org/browse/TEIID-3937?page=com.atlassian.jira.plugin... ]
Don Krapohl commented on TEIID-3937:
------------------------------------
Added detail. Summary:
Impala translator
Can cast all to double and output as double and the formula pushes down.
If output is DECIMAL or BIGDECIMAL doesn't matter whether you cast or not, it doesn't send it down.
Our example has two BIGDECIMAL and one BIGINT source columns.
> 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
>
> In the Impala translator, pushdown doesn't happen when two columns are multiplied in the THEN portion of a CASE statement with bigdecimal 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 BIGDECIMAL output
> CASE WHEN column1 IS NOT NULL
> THEN cast(column1 as BIGDECIMAL ) * cast(column2 as BIGDECIMAL )
> ELSE cast(column3 as BIGDECIMAL ) 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 BIGDECIMAL
> Column2 is BIGINT/LONG
> Column3 is BIGDECIMAL
> Output column is BIGDECIMAL
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (TEIID-3937) Multiplying two columns in CASE statement overrides pushdown (Impala)
by Don Krapohl (JIRA)
[ https://issues.jboss.org/browse/TEIID-3937?page=com.atlassian.jira.plugin... ]
Don Krapohl updated TEIID-3937:
-------------------------------
Description:
In the Impala translator, pushdown doesn't happen when two columns are multiplied in the THEN portion of a CASE statement with bigdecimal 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 BIGDECIMAL output
CASE WHEN column1 IS NOT NULL
THEN cast(column1 as BIGDECIMAL ) * cast(column2 as BIGDECIMAL )
ELSE cast(column3 as BIGDECIMAL ) 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 BIGDECIMAL
Column2 is BIGINT/LONG
Column3 is BIGDECIMAL
Output column is BIGDECIMAL
was:
Pushdown doesn't happen when two columns are multiplied in the THEN portion of a CASE statement with bigdecimal 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
We're ouputting as bigdecimal so that may be a factor in the decision to push down as double datatype does work.
> 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
>
> In the Impala translator, pushdown doesn't happen when two columns are multiplied in the THEN portion of a CASE statement with bigdecimal 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 BIGDECIMAL output
> CASE WHEN column1 IS NOT NULL
> THEN cast(column1 as BIGDECIMAL ) * cast(column2 as BIGDECIMAL )
> ELSE cast(column3 as BIGDECIMAL ) 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 BIGDECIMAL
> Column2 is BIGINT/LONG
> Column3 is BIGDECIMAL
> Output column is BIGDECIMAL
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (TEIID-3937) Multiplying two columns in CASE statement overrides pushdown (Impala)
by Don Krapohl (JIRA)
[ https://issues.jboss.org/browse/TEIID-3937?page=com.atlassian.jira.plugin... ]
Don Krapohl updated TEIID-3937:
-------------------------------
Summary: Multiplying two columns in CASE statement overrides pushdown (Impala) (was: Multiplying two columns in CASE statement overrides pushdown)
> 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
>
> Pushdown doesn't happen when two columns are multiplied in the THEN portion of a CASE statement with bigdecimal 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
> We're ouputting as bigdecimal so that may be a factor in the decision to push down as double datatype does work.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months