[
https://issues.apache.org/jira/browse/CALCITE-4872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17450692#comment-17450692
]
Julian Hyde commented on CALCITE-4872:
--------------------------------------
Yes, there's a difference between {{ANY}} and {{UNKNOWN}}, but it's not very
well defined. I'm not very sure what the definitions are, or what they should
be.
The definitions, such as they are, are in the descriptions of the types (e.g.
in reference.md and SqlTypeName), in the test suite, and in people's
expectations. The way to improve those definitions is by writing tests,
proposing changes to existing tests, proposing changes to those definitions,
and discussions.
I'm going to throw into the mix a proposed {{VARIANT}} type. Unlike {{ANY}} and
{{UNKNOWN}}, {{VARIANT}} actually exists in commercial databases (MSSQL,
Snowflake, Teradata). It would be useful for [Snowflake-style JSON
support|https://lists.apache.org/thread/2zvqqbsg6t9zr3njjo8mfpxt2fkfo5nx] which
is similar to the late-binding schema implemented in Drill and proposed for
Calcite in CALCITE-1257.
> UNKNOWN SqlTypeName erroneously treated as NULL
> -----------------------------------------------
>
> Key: CALCITE-4872
> URL: https://issues.apache.org/jira/browse/CALCITE-4872
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Will Noble
> Assignee: Will Noble
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.29.0
>
> Time Spent: 2h
> Remaining Estimate: 0h
>
> Call {{createWithNullability}} on an {{UnknownSqlType}} currently returns a
> {{NULL}} type. Furthermore, it's impossible to cast to unknown types,
> according to {{SqlTypeUtil.canCastFrom}}. This introduces a new
> {{SqlTypeName}} -- {{UNKNOWN}} -- which behaves like {{NULL}} in all ways
> except that it's no longer actually equal to {{NULL}}, and can always be cast
> to.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)