drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "N Campbell (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-5653) Extract(year) from SQL Server date and datetime2 types fail with ClassCastException: org.apache.calcite.avatica.util.TimeUnitRange
Date Sat, 01 Jul 2017 15:52:00 GMT
N Campbell created DRILL-5653:
---------------------------------

             Summary: Extract(year) from SQL Server date and datetime2 types fail with ClassCastException:
org.apache.calcite.avatica.util.TimeUnitRange 
                 Key: DRILL-5653
                 URL: https://issues.apache.org/jira/browse/DRILL-5653
             Project: Apache Drill
          Issue Type: Bug
          Components:  Server
    Affects Versions: 1.10.0
         Environment: Drill 1.10
SQL Server 2016

            Reporter: N Campbell


plugin defined to SQL Server 2016 via JDBC

select TDT.RNUM, extract( year from TDT.CDT ) from certsqlserver.dbo.TDT 

SYSTEM ERROR: ClassCastException: org.apache.calcite.avatica.util.TimeUnitRange cannot be
cast to org.apache.calcite.sql.SqlLiteral$SqlSymbol

select TTS.RNUM, extract( year from TTS.CTS ) from certsqlserver.dbo.TTS 

SYSTEM ERROR: ClassCastException: org.apache.calcite.avatica.util.TimeUnitRange cannot be
cast to org.apache.calcite.sql.SqlLiteral$SqlSymbol

SQL Server DLL



create table "TDT" ( "RNUM" integer  not null , "CDT" date   );
go
			

grant select on "TDT" to public;
go
			
insert into "TDT"("RNUM", "CDT") values ( 0, NULL);
go
			
insert into "TDT"("RNUM", "CDT") values ( 1, '1996-01-01');
go
			
insert into "TDT"("RNUM", "CDT") values ( 2, '2000-01-01');
go
			
insert into "TDT"("RNUM", "CDT") values ( 3, '2000-12-31');
go
			

create table "TTS" ( "RNUM" integer  not null , "CTS" datetime2(3 )    );
go
			

grant select on "TTS" to public;
go
			
insert into "TTS"("RNUM", "CTS") values ( 0, NULL);
go
			
insert into "TTS"("RNUM", "CTS") values ( 1, '1996-01-01 00:00:00.000000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 2, '1996-01-01 12:00:00.000000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 3, '1996-01-01 23:59:30.123000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 4, '2000-01-01 00:00:00.000000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 5, '2000-01-01 12:00:00.000000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 6, '2000-01-01 23:59:30.123000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 7, '2000-12-31 00:00:00.000000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 8, '2000-12-31 12:00:00.000000000');
go
			
insert into "TTS"("RNUM", "CTS") values ( 9, '2000-12-31 12:15:30.123000000');
go
			




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message