[JBoss JIRA] (TEIID-5092) Joining tables from S3 occasionaly fails with NumberFormatException
by Andrej Šmigala (JIRA)
[ https://issues.jboss.org/browse/TEIID-5092?page=com.atlassian.jira.plugin... ]
Andrej Šmigala commented on TEIID-5092:
---------------------------------------
There is no bad data involved here.
This exception comes from SimpleDateFormat.parse method. On [line 488|https://github.com/teiid/teiid/blob/64-8.12.x/connectors/translator-a...] in S3ProcedureExecution, that method is called with the value of the "Last-Modified" header returned by S3 from the http call. I verified the headers returned by S3 are correct, even in the situation where the exception occurs.
What I'm assuming happens is that when doing a join, multiple S3ProcedureExecution instances are created and their next() methods are called from different threads, which in turn means the parse() method is called on the same SimpleDateFormat instance from multiple threads. SimpleDateFormat is [not thread safe|https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat...], so this results in its internal data to become corrupted and throw NumberFormatException from deep within.
I verified this assumption by removing the static modifier from the df field on [line 73|https://github.com/teiid/teiid/blob/64-8.12.x/connectors/translator-am...], after which the exception never occured. (I did not create a PR with this change because instantiation of a SimpleDateFormat is reportedly an expensive operation, so this will require a proper synchronization).
> Joining tables from S3 occasionaly fails with NumberFormatException
> -------------------------------------------------------------------
>
> Key: TEIID-5092
> URL: https://issues.jboss.org/browse/TEIID-5092
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
> Priority: Critical
>
> Running any query that reads multiple tables from an Amazon S3 datasource sometimes fails with the following exception:
> {noformat}
> [org.teiid.CONNECTOR] (Worker0_QueryProcessorQueue3373) Connector worker process failed for atomic-request=ZwjBqkPjJdw2.386.4.689: java.lang.NumberFormatException: For input string: ""
> at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) [rt.jar:1.8.0_131]
> at java.lang.Long.parseLong(Long.java:601) [rt.jar:1.8.0_131]
> at java.lang.Long.parseLong(Long.java:631) [rt.jar:1.8.0_131]
> at java.text.DigitList.getLong(DigitList.java:195) [rt.jar:1.8.0_131]
> at java.text.DecimalFormat.parse(DecimalFormat.java:2051) [rt.jar:1.8.0_131]
> at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1869) [rt.jar:1.8.0_131]
> at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1514) [rt.jar:1.8.0_131]
> at java.text.DateFormat.parse(DateFormat.java:364) [rt.jar:1.8.0_131]
> at org.teiid.translator.amazon.s3.S3ProcedureExecution.next(S3ProcedureExecution.java:488) [translator-amazon-s3-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:433)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:236)
> at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source) [:1.8.0_131]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_131]
> at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_131]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy79.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_131]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
> 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:1142) [rt.jar:1.8.0_131]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_131]
> at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_131]
> {noformat}.
> The actual input string reffered to in the stack trace occasionaly contains garbage data.
> This is caused by unsynchronized access to a static SimpleDateFormat field here: https://github.com/teiid/teiid/blob/64-8.12.x/connectors/translator-amazo...
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5093) Amazon s3 csv/xml lookup querry exception
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-5093?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-5093:
-------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1499869
Bugzilla Update: Perform
> Amazon s3 csv/xml lookup querry exception
> -----------------------------------------
>
> Key: TEIID-5093
> URL: https://issues.jboss.org/browse/TEIID-5093
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.x-6.4
> Reporter: Mario Majernik
> Assignee: Steven Hawkins
>
> Querry :
> {code:java}
> SELECT IntKey, StringKey, lookup('BQT1.SmallB', 'DoubleNum', 'IntKey', IntKey) AS DoubleNum FROM BQT1.SmallA UNION SELECT IntKey, lookup('BQT1.SmallA', 'StringKey', 'IntKey', IntKey) AS StringKey, DoubleNum FROM BQT1.SmallA
> {code}
> returns TeiidSQLException for csv and xml files from amazon s3.
> Stacktrace:
> {code:java}
> WARN [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue41) TEIID30020 Processing exception for request 8O9K6VJIjd9y.7 'TEIID30180 java.sql.SQLException: java.sql.SQLException: TEIID60019 Streaming result has already been read once. Ensure that only one read operation needs to be performed, for example XMLPARSE without the WELLFORMED operation must read the entire stream to validate its contents. Or you may choose to use a non-streaming result. '. Originally TeiidProcessingException BinaryWSProcedureExecution.java:78. Enable more detailed logging to see the entire stacktrace.
> {code}
> Teiid command log for querry:
> {code:java}
> 15:11:34,160 INFO [org.teiid.COMMAND_LOG] (New I/O worker #2) 8O9K6VJIjd9y START USER COMMAND: startTime=2017-10-09 15:11:34.16 requestID=8O9K6VJIjd9y.7 txID=null sessionID=8O9K6VJIjd9y applicationName=JDBC principal=user@teiid-security vdbName=csv vdbVersion=1 sql=SELECT IntKey, StringKey, lookup('BQT1.SmallB', 'DoubleNum', 'IntKey', IntKey) AS DoubleNum FROM BQT1.SmallA UNION SELECT IntKey, lookup('BQT1.SmallA', 'StringKey', 'IntKey', IntKey) AS StringKey, DoubleNum FROM BQT1.SmallA
> 15:11:34,192 DEBUG [org.teiid.COMMAND_LOG] (Worker0_QueryProcessorQueue40) 8O9K6VJIjd9y START DATA SRC COMMAND: startTime=2017-10-09 15:11:34.192 requestID=8O9K6VJIjd9y.7 sourceCommandID=6 executionID=2 txID=null modelName=sourceModel translatorName=user-s3 sessionID=8O9K6VJIjd9y principal=user@teiid-security sql=EXEC sourceModel.getTextFile('csv/smallaCsv.csv')
> 15:11:34,856 DEBUG [org.teiid.COMMAND_LOG] (Worker2_QueryProcessorQueue41) 8O9K6VJIjd9y END SRC COMMAND: endTime=2017-10-09 15:11:34.856 requestID=8O9K6VJIjd9y.7 sourceCommandID=6 executionID=2 txID=null modelName=sourceModel translatorName=user-s3 sessionID=8O9K6VJIjd9y principal=user@teiid-security finalRowCount=1 cpuTime(ns)=34673443
> 15:11:34,862 INFO [org.teiid.COMMAND_LOG] (Worker2_QueryProcessorQueue41) 8O9K6VJIjd9y ERROR USER COMMAND: endTime=2017-10-09 15:11:34.862 requestID=8O9K6VJIjd9y.7 txID=null sessionID=8O9K6VJIjd9y principal=user@teiid-security vdbName=csv vdbVersion=1 finalRowCount=null
> 15:11:34,876 INFO [org.teiid.COMMAND_LOG] (Worker2_QueryProcessorQueue41) 8O9K6VJIjd9y END USER COMMAND: endTime=2017-10-09 15:11:34.876 requestID=8O9K6VJIjd9y.7 txID=null sessionID=8O9K6VJIjd9y principal=user@teiid-security vdbName=csv vdbVersion=1 finalRowCount=0
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5089) Using Teiid Conn. importer in Designer, the cache name is set to "default"
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-5089?page=com.atlassian.jira.plugin... ]
Van Halbert commented on TEIID-5089:
------------------------------------
Confirmed this is working with the latest TD 11.1 and the lastest local build of the jdg changes for the jdg repo.
> Using Teiid Conn. importer in Designer, the cache name is set to "default"
> --------------------------------------------------------------------------
>
> Key: TEIID-5089
> URL: https://issues.jboss.org/browse/TEIID-5089
> Project: Teiid
> Issue Type: Bug
> Components: Infinispan
> Affects Versions: 8.12.x-6.4
> Reporter: Van Halbert
> Assignee: Ramesh Reddy
> Fix For: 10.0, 8.12.x-6.4
>
>
> When using the Teiid Connection importer in Designer to reversen engineer the source table from an existing JDG cache. The following is an example of the DDL returned by teiid:
> {code}
> SET NAMESPACE 'http://www.teiid.org/translator/infinispan/2017' AS teiid_ispn;
> CREATE FOREIGN TABLE Person (
> id integer OPTIONS (ANNOTATION '@Id', SEARCHABLE 'Searchable', NATIVE_TYPE 'int32', "teiid_ispn:TAG" '1'),
> name string OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'string', "teiid_ispn:TAG" '2'),
> salary double OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'double', "teiid_ispn:TAG" '3'),
> CONSTRAINT PK_ID PRIMARY KEY(id)
> ) OPTIONS (ANNOTATION '@Indexed', NAMEINSOURCE 'JDGPersonCache.Person', UPDATABLE TRUE, "teiid_ispn:CACHE" 'default');
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5094) Is DISTINCT FROM evaluation with two null values
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5094:
-------------------------------------
Summary: Is DISTINCT FROM evaluation with two null values
Key: TEIID-5094
URL: https://issues.jboss.org/browse/TEIID-5094
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.12
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Priority: Critical
Fix For: 9.2.7, 10.0, 9.3.4
'row(null) is distinct from row(null)" evaluates to true when true is expected.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months