git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2305) Invalid casting for some postgres types


Chris Baynes created CALCITE-2305:
-------------------------------------

             Summary: Invalid casting for some postgres types
                 Key: CALCITE-2305
                 URL: https://issues.apache.org/jira/browse/CALCITE-2305
             Project: Calcite
          Issue Type: Bug
          Components: jdbc-adapter
    Affects Versions: 1.16.0
            Reporter: Chris Baynes
            Assignee: Julian Hyde


The types `TINYINT` and `DOUBLE` do not exist in Postgres, so attempting to cast to them throws a runtime exception, e.g.

 
{code:java}
// query
select CAST("store_id" as TINYINT) from "foodmart"."expense_fact"

// exception
java.lang.RuntimeException: exception while executing [select CAST("store_id" as TINYINT) from "foodmart"."expense_fact"]
at org.apache.calcite.test.JdbcAdapterTest.testCast(JdbcAdapterTest.java:478)
Caused by: java.lang.RuntimeException: With materializationsEnabled=false, limit=0
at org.apache.calcite.test.JdbcAdapterTest.testCast(JdbcAdapterTest.java:478)
Caused by: java.sql.SQLException: 
Error while executing SQL "select CAST("store_id" as TINYINT) from "foodmart"."expense_fact"": while executing SQL [SELECT CAST("store_id" AS TINYINT)
FROM "public"."expense_fact"]
at org.apache.calcite.test.JdbcAdapterTest.testCast(JdbcAdapterTest.java:478)
Caused by: java.lang.RuntimeException: 
while executing SQL [SELECT CAST("store_id" AS TINYINT)
FROM "public"."expense_fact"]
at org.apache.calcite.test.JdbcAdapterTest.testCast(JdbcAdapterTest.java:478)
Caused by: org.postgresql.util.PSQLException: 
ERROR: type "tinyint" does not exist
Position: 27
at org.apache.calcite.test.JdbcAdapterTest.testCast(JdbcAdapterTest.java:478)
{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-calcite-development/msg03444.html on line 115
Call Stack
#TimeMemoryFunctionLocation
10.0008364696{main}( ).../msg03444.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-calcite-development/msg03444.html on line 115
Call Stack
#TimeMemoryFunctionLocation
10.0008364696{main}( ).../msg03444.html:0