dynamobi/dynamobi — Issue #850: [FRG-20] casting fails for TIMESTAMP to DATE/TIME and VARBINARY to BINARY when selecting from one table to insert into another
Author: dynamobi-build
Created: 2011-12-30 03:52:45+00:00
State: open
Labels: FRG

[reporter="elin", created="Mon, 16 Jan 2006 16:22:51 -0500 (GMT-05:00)"]
Casting for the data types below get an UnsupportedOperationException when you do the following procedure.

TIMESTAMP <-> TIME

TIMESTAMP <-> DATE

VARBINARY <-> BINARY

---------------------------

Procedure:

create table t1(pkey integer, colname varchar(20), coltmstamp timestamp, primary key(pkey));

insert into t1 values(1, 'TIME', '1945-2-24 12:42:25.34');

create table t2(coltime time primary key);

insert into t2 select coltmstamp from t1 where colname = 'TIME';

Error log:

Error: java.lang.UnsupportedOperationException: class java.lang.String: Cast from 'TIMESTAMP' to 'TIME' (state=,code=0)

net.sf.farrago.util.FarragoUtil$FarragoSqlException: java.lang.UnsupportedOperationException: class java.lang.String: Cast from 'TIMESTAMP' to 'TIME'

at org.eigenbase.util.Util.needToImplement(Util.java:976)

at com.disruptivetech.farrago.calc.CalcRexImplementorTableImpl$CastImplementor.implement(CalcRexImplementorTableImpl.java:1117)

at com.disruptivetech.farrago.calc.RexToCalcTranslator.implementNode(RexToCalcTranslator.java:919)

at com.disruptivetech.farrago.calc.RexToCalcTranslator.visitCall(RexToCalcTranslator.java:736)

at org.eigenbase.rex.RexCall.accept(RexCall.java:201)

at com.disruptivetech.farrago.calc.RexToCalcTranslator.implementNode(RexToCalcTranslator.java:716)

at com.disruptivetech.farrago.calc.RexToCalcTranslator.getProgram(RexToCalcTranslator.java:480)

at com.disruptivetech.farrago.calc.RexToCalcTranslator.getProgram(RexToCalcTranslator.java:398)

at com.disruptivetech.farrago.rel.FennelCalcRel.toStreamDef(FennelCalcRel.java:188)

at net.sf.farrago.query.FarragoRelImplementor.visitFennelChild(FarragoRelImplementor.java:93)

at com.lucidera.lcs.LcsTableAppendRel.toStreamDef(LcsTableAppendRel.java:333)

at net.sf.farrago.query.FarragoRelImplementor.visitFennelChild(FarragoRelImplementor.java:93)

at net.sf.farrago.query.FennelToIteratorConverter.childToStreamDef(FennelToIteratorConverter.java:418)

at net.sf.farrago.query.FennelToIteratorConverter.implement(FennelToIteratorConverter.java:146)

at org.eigenbase.oj.rel.JavaRelImplementor.visitChildInternal(JavaRelImplementor.java:380)

at net.sf.farrago.query.FarragoRelImplementor.visitChildInternal(FarragoRelImplementor.java:108)

at org.eigenbase.oj.rel.JavaRelImplementor.visitChild(JavaRelImplementor.java:367)

at org.eigenbase.oj.rel.JavaRelImplementor.visitJavaChild(JavaRelImplementor.java:341)

at org.eigenbase.oj.rel.JavaRelImplementor.implementRoot(JavaRelImplementor.java:397)

at net.sf.farrago.query.FarragoRelImplementor.implementRoot(FarragoRelImplementor.java:265)

at org.eigenbase.oj.stmt.OJPreparingStmt.implement(OJPreparingStmt.java:301)

at org.eigenbase.oj.stmt.OJPreparingStmt.prepareSql(OJPreparingStmt.java:256)

at net.sf.farrago.query.FarragoPreparingStmt.prepare(FarragoPreparingStmt.java:238)

at net.sf.farrago.db.FarragoDatabase$2.initializeEntry(FarragoDatabase.java:630)

at net.sf.farrago.util.FarragoObjectCache.pin(FarragoObjectCache.java:157)

at net.sf.farrago.db.FarragoDatabase.prepareStmtImpl(FarragoDatabase.java:640)

at net.sf.farrago.db.FarragoDatabase.prepareStmt(FarragoDatabase.java:520)

at net.sf.farrago.db.FarragoDbSession.prepareImpl(FarragoDbSession.java:773)

at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:724)

at net.sf.farrago.db.FarragoDbStmtContext.prepare(FarragoDbStmtContext.java:152)

at net.sf.farrago.jdbc.engine.FarragoJdbcEngineStatement.execute(FarragoJdbcEngineStatement.java:104)

at sqlline.SqlLine$Commands.execute(Unknown Source)

at sqlline.SqlLine$Commands.sql(Unknown Source)

at sqlline.SqlLine.dispatch(Unknown Source)

at sqlline.SqlLine.begin(Unknown Source)

at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)

at sqlline.SqlLine.main(Unknown Source)