VARCHAR typically has a default precision set by the rel data type system.
For instance, in Hive, the HiveTypeSystemImpl sets the default precision to
65536.

Julian Hyde <[email protected]> 于2024年12月3日周二 23:35写道:

> Yes VARCHAR preserves trailing spaces.
>
> But your question is more about the semantics of CHAR. The literal is a
> CHAR(2). I think we should retain the trailing space in that string when we
> reinterpret it as a VARCHAR. But I’m not sure that we do.
>
> > On Dec 2, 2024, at 7:40 PM, Mihai Budiu <[email protected]> wrote:
> >
> > What is the meaning of VARCHAR(N) and VARCHAR in Calcite?
> > Does VARCHAR preserve trailing spaces?
> > What is the output of this query
> >
> > SELECT CAST('x ' AS VARCHAR) || 'y'
> >
> > Mihai
>

Reply via email to