You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Pavel Gubin <pv...@gmail.com> on 2020/07/20 11:44:48 UTC
[DISCUSS] SqlDialect.getCastSpec() doesn't work when unparsing
SqlNode tree
Currently SqlDialect.getCastSpec() is used to amend types to cast to for different dialects and works during Rel to Sql conversion. That means it cannot be used when unparsing SqlNode tree to a specific dialect. Does somebody know was it made intentionally and would it be better to provide alternative method to convert cast types fully in SqlNode tree that can be used during SqlNode.unparse()?
Thanks,
Pavel Gubin
Re: [DISCUSS] SqlDialect.getCastSpec() doesn't work when unparsing
SqlNode tree
Posted by Rui Wang <am...@apache.org>.
Hi Pavel,
Not sure if I understand your question, does override
"SqlDialect.unparseCall" [1] provide an entry point to customize CAST
unparsing per dialect?
[1]:
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/SqlDialect.java#L442
-Rui
On Mon, Jul 20, 2020 at 4:44 AM Pavel Gubin <pv...@gmail.com> wrote:
> Currently SqlDialect.getCastSpec() is used to amend types to cast to for
> different dialects and works during Rel to Sql conversion. That means it
> cannot be used when unparsing SqlNode tree to a specific dialect. Does
> somebody know was it made intentionally and would it be better to provide
> alternative method to convert cast types fully in SqlNode tree that can be
> used during SqlNode.unparse()?
>
> Thanks,
> Pavel Gubin