[jira] [Created] (CALCITE-2961) Enable Travis to test against JDK 13

2019-03-29 Thread Kevin Risden (JIRA)
Kevin Risden created CALCITE-2961:
-

 Summary: Enable Travis to test against JDK 13
 Key: CALCITE-2961
 URL: https://issues.apache.org/jira/browse/CALCITE-2961
 Project: Calcite
  Issue Type: Improvement
  Components: build
Reporter: Kevin Risden
Assignee: Kevin Risden
 Fix For: avatica-1.14.0, 1.20.0


The docker hub Maven image recently added support for JDK 13.



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


Re: insert timestamp value into postgresql

2019-03-29 Thread Julian Hyde
Calcite is certainly poor at doing implicit type casts (e.g. VARCHAR to 
TIMESTAMP).

However, it can do implicit conversions between types with the same type name 
for type family but different precision/scale. You can compare a DECIMAL(5, 0) 
with a DECIMAL(4, 2), for example. And you can insert a CHAR(3) into a 
VARCHAR(10) column. In other words, there is more flexibility as long as you 
are within the same type family.

We try hard to be consistent with the SQL standard, and I believe that we are. 
However we should definitely go further and allow more flexibility.

Julian
 

> On Mar 28, 2019, at 7:24 PM, Yuzhao Chen  wrote:
> 
> Calcite does not support implicit type cast yet, so it is strict for type 
> compare, e.g. two decimals with different precision or scale will be 
> considered different type. For timestamp(3) and varchar, they are definitely 
> different data types.
> 
> You can make explicit type cast before inserting into target table.
> 
> Best,
> Danny Chan
> 在 2019年3月29日 +0800 AM9:44,勾王敏浩 ,写道:
>> Hi,
>> My Name is Wangminhao Gou,I hava used calcite to operate several relational 
>> databases including PG,however,when I want to insert timestamp value,there 
>> is an exception.The information is like this:
>> org.apache.calcite.runtime.CalciteContextException: From line 1, column 47 
>> to line 1, column 60: Cannot assign to target field 'plt_createtime' of type 
>> TIMESTAMP(3) from source field 'EXPR$1' of type CHAR(23)
>> Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Cannot 
>> assign to target field 'plt_createtime' of type TIMESTAMP(3) from source 
>> field 'EXPR$1' of type CHAR(23)
>> however when I used the same SQL statement in the navicat towards the PG,it 
>> succeeds.
>> What should I do then?Thank you.
>> 
>> 
>> Sincerely,
>> Wangminhao Gou
>>