You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/03/09 02:01:38 UTC
[jira] [Commented] (CALCITE-1684) Set the precision for VARCHAR and
VARBINARY to the maximum value when not specified
[ https://issues.apache.org/jira/browse/CALCITE-1684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15902326#comment-15902326 ]
Julian Hyde commented on CALCITE-1684:
--------------------------------------
I basically agree. I would like to VARCHAR and VARBINARY of unbounded length, similar to the "String" or "Text" types in some databases. I would store a precision of -1, and print the type as "VARCHAR(*)" or something. I don't want anyone to think that you can store a string of length 2^31-1 but not a string of length 2^31, because that's not true.
> Set the precision for VARCHAR and VARBINARY to the maximum value when not specified
> -----------------------------------------------------------------------------------
>
> Key: CALCITE-1684
> URL: https://issues.apache.org/jira/browse/CALCITE-1684
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.11.0
> Reporter: Kevin Liew
> Assignee: Julian Hyde
> Priority: Minor
>
> The behavior for Calcite (and SQL Server) is to set {{VARCHAR}} precision to {{1}} when not specified whereas Phoenix sets the max integer value of {{2147483647}}.
> It doesn't really make sense to create a {{VARCHAR}} for a max length of {{1}} (it takes more bytes to store the length of each row than the actual value) and it shouldn't be the default behavior. I think we should adopt the Phoenix behavior. Do we need to make this configurable via SqlConformance or other?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)