[
https://issues.apache.org/jira/browse/CALCITE-4724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde updated CALCITE-4724:
---------------------------------
Description:
In JDBC adapter for ClickHouse, implement {{Values}} by generating {{SELECT}}
without {{FROM}}. In {{ClickHouseSqlDialect}}, the {{supportsAliasedValues()}}
method should return false.
We use ClickHouseSqlDialect to do some sql optimize. For sql {{select 1}}, in
the process of sqlNode → relNode → sqlNode, the sql string will be
transformed to
{code:java}
SELECT *
FROM (VALUES (1)) AS `t` (`EXPR$0`)
{code}
Since clickhouse is not support AliasedValues, all we need to do is to extend
ClickHouseSqlDialect and make `supportsAliasedValues` return false.
Maybe this kind of behavior can integrated into core?
If needed, the pull request is ready.
was:
We use ClickHouseSqlDialect to do some sql optimize.
for sql `select 1`, in the process of sqlNode -> relNode -> sqlNode, the sql
string will be transformed to
{code:java}
SELECT *
FROM (VALUES (1)) AS `t` (`EXPR$0`)
{code}
Since clickhouse is not support AliasedValues, all we need to do is to extend
ClickHouseSqlDialect and make `supportsAliasedValues` return false.
Maybe this kind of behavior can integrated into core?
If needed, the pull request is ready.
> In JDBC adapter for ClickHouse, implement Values by generating SELECT without
> FROM
> ----------------------------------------------------------------------------------
>
> Key: CALCITE-4724
> URL: https://issues.apache.org/jira/browse/CALCITE-4724
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.27.0
> Reporter: Enze Liu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.28.0
>
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> In JDBC adapter for ClickHouse, implement {{Values}} by generating {{SELECT}}
> without {{FROM}}. In {{ClickHouseSqlDialect}}, the
> {{supportsAliasedValues()}} method should return false.
> We use ClickHouseSqlDialect to do some sql optimize. For sql {{select 1}},
> in the process of sqlNode → relNode → sqlNode, the sql string will
> be transformed to
> {code:java}
> SELECT *
> FROM (VALUES (1)) AS `t` (`EXPR$0`)
> {code}
> Since clickhouse is not support AliasedValues, all we need to do is to extend
> ClickHouseSqlDialect and make `supportsAliasedValues` return false.
> Maybe this kind of behavior can integrated into core?
> If needed, the pull request is ready.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)