[ 
https://issues.apache.org/jira/browse/CALCITE-7244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18034207#comment-18034207
 ] 

Julian Hyde commented on CALCITE-7244:
--------------------------------------

You are asking for a classic “drill a hole” change. Allowing people to subclass 
RexLiteral and override or disable validation doesn’t add any functionality - 
as correctly say, there’s nothing to test - but lets people introduce bugs. If 
someone decides to allow the string “maybe” as a literal of type BOOLEAN, this 
is going to trip up Calcite and volunteer time may be wasted investigating 
these “bugs”. 

This change solves your problem but I’m not sure that it is a net improvement 
to the project. 

I would much rather you find a way to express your problem in a way - say a 
type system - that matches other people’s requirements. Calcite became what it 
is today because we strove to find common ground in requirements. 

> Support for VARCHAR RexLiteral
> ------------------------------
>
>                 Key: CALCITE-7244
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7244
>             Project: Calcite
>          Issue Type: Wish
>            Reporter: Steve Carlin
>            Priority: Major
>
> Oh, the powers that be:
> I would be oh so happy if we can remove this line of code:
> [https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rex/RexLiteral.java#L381|https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rex/RexLiteral.java#L374]
> ...or at least allow a character RexLiteral to be created with type VARCHAR
> You see, when I do a CTAS statement with a "select 'hello'", it creates a 
> STRING datatype, not a CHAR datatype in my database.  Since I currently can't 
> create a RexLiteral VARCHAR, I have to introduce a CAST around the literal, 
> and I can't do this until RelNode/RexNode time.  Even worse, when I have a 
> Values RelNode, I have to create a Project on top of the Values with a cast.
> Please, oh please, take this into consideration and allow this.  It would 
> make my code a lot simpler.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to