Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1141685 (TEIID-3133)

Summary: Impala Time/Date/Timestamp handling
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Filip Nguyen <fnguyen>
Component: TeiidAssignee: jolee
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: asmigala, fnguyen, jolee, vhalbert
Target Milestone: ER5Keywords: QA-Closed
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1207220 (view as bug list) Environment:
Last Closed: 2016-02-10 08:51:04 UTC Type: Support Patch
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1185069    
Bug Blocks:    
Attachments:
Description Flags
full server log none

Description Filip Nguyen 2014-09-15 08:52:36 UTC
Impala supports only TIMESTAMP datatype (see here http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/Impala/Installing-and-Using-Impala/ciiu_porting.html) 

I converted everything into timestamp and now I am trying to get Date and Time parts of the timestamp in Teiid e.g.

SELECT DISTINCT convert(Source.SmallA.TimeValue, time) as TimeValue FROM Source.SmallA ORDER BY TimeValue

But I get TranslatorException: Unexpected exception while translating results: Method not supported


I tried to workaround this but with limited success. For Date it is possible to use to_date function that returns string reprsentation of the date part. For Time I wasn't able to find the solution (have not yet figured out how to use extract function through Teiid).

http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/Impala/Installing-and-Using-Impala/ciiu_datetime_functions.html

Document URL: 

Section Number and Name: 

Describe the issue: 

Suggestions for improvement: 

Additional information:

Comment 1 Filip Nguyen 2014-09-15 09:02:29 UTC
Ok I was successfull extracting the time part by using Teiid EXTRACT function. However, its highly inconvenient, is there another way?

Comment 3 Van Halbert 2014-09-17 15:16:14 UTC
What is the full exception?  Presumably it's failing on ResultSet.getTimestamp.

Comment 4 Filip Nguyen 2014-09-25 09:01:37 UTC
Created attachment 941020 [details]
full server log

Comment 5 JBoss JIRA Server 2014-10-02 14:15:07 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3133 to Resolved

Comment 6 Filip Nguyen 2014-10-24 08:43:34 UTC
With ER3 I am getting [1] for the conversion of a timestamp to a Date:

 convert(Source.smalla.DATEVALUE, date) AS DateValue

[1] 
org.teiid.jdbc.TeiidSQLException: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 Source: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT DISTINCT cast(g_0.DATEVALUE AS date) AS c_0 FROM smalla g_0 ORDER BY c_0]
	at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)
	at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)
	at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:667)
	at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:63)
	at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:515)
	at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135)
	at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40)
	at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79)
	at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:264)
	at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:302)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.teiid.net.socket.SocketServerConnectionFactory$ShutdownHandler.invoke(SocketServerConnectionFactory.java:98)
	at com.sun.proxy.$Proxy1.read(Unknown Source)
	at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:401)
	at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:524)
	at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:393)
	at org.teiid.jdbc.StatementImpl.executeQuery(StatementImpl.java:327)
	at JDBCClient.execute(JDBCClient.java:80)
	at JDBCClient.main(JDBCClient.java:46)
Caused by: org.teiid.core.TeiidProcessingException: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 Source: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT DISTINCT cast(g_0.DATEVALUE AS date) AS c_0 FROM smalla g_0 ORDER BY c_0]
	at org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:381)
	at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:154)
	at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:369)
	at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278)
	at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:136)
	at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
	at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
	at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:159)
	at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:141)
	at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:444)
	at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:326)
	at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
	at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:254)
	at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274)
	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)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.teiid.core.TeiidException: 0 Remote org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT DISTINCT cast(g_0.DATEVALUE AS date) AS c_0 FROM smalla g_0 ORDER BY c_0]
	at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131)
	at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:325)
	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)
	at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
	... 6 more
Caused by: java.sql.SQLException: Remote java.sql.SQLException: AnalysisException: Invalid type cast of g_0.DATEVALUE from TIMESTAMP to DATE

Comment 7 JBoss JIRA Server 2014-10-24 12:25:48 UTC
Van Halbert <vhalbert> updated the status of jira TEIID-3133 to Reopened

Comment 8 Van Halbert 2014-10-24 12:45:04 UTC
Opened a new Teiid related to handling of TimeStamp

Comment 9 Van Halbert 2014-10-24 18:21:47 UTC
What translator is being used?  Asking because the impala translator shouldn't allow the pushdown of the conversion to timestamp to date, but the hive translator should.

Comment 10 JBoss JIRA Server 2014-10-27 17:37:19 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3133 to Resolved

Comment 11 Filip Nguyen 2014-11-25 13:32:50 UTC
Using Impala translator

Comment 12 JBoss JIRA Server 2014-11-25 20:55:12 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3187 to Resolved

Comment 13 Filip Nguyen 2015-02-03 10:46:04 UTC
With ER6 I still see the same behaviour as in Comment 6 and in JIRA TEIID-3187

Comment 14 Van Halbert 2015-02-03 13:21:40 UTC
Can you provide how you reproduced the issue?

Comment 16 JBoss JIRA Server 2015-04-02 18:33:28 UTC
Johnathon Lee <jolee> updated the status of jira TEIID-3133 to Reopened

Comment 17 JBoss JIRA Server 2015-04-02 18:33:50 UTC
Johnathon Lee <jolee> updated the status of jira TEIID-3133 to Closed

Comment 19 Andrej Smigala 2015-04-28 12:11:16 UTC
There appears to be some kind of confusion. It seems this issue has already been fixed in GA. I am able to reproduce it with 6.1 ER2, but not with 6.1 GA. Also, looking at the associated commits, it seems they have already been merged in november.

Comment 20 jolee 2015-04-28 15:09:10 UTC
Code affecting TEIID-3113 was included as it was affected by changes to TEIID-3187.  I leaned towards capturing that there was a change to the related code of the JIRA.  If these changes don't cause a regression,  I think we are good.

Comment 21 JBoss JIRA Server 2015-10-11 19:18:37 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3187 to Closed