[
https://issues.apache.org/jira/browse/CALCITE-3423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wang Yanlin updated CALCITE-3423:
---------------------------------
Summary: Support using CAST operation and BOOLEAN type value in table macro
(was: Support using CAST operation and bool type value in table macro)
> Support using CAST operation and BOOLEAN type value in table macro
> ------------------------------------------------------------------
>
> Key: CALCITE-3423
> URL: https://issues.apache.org/jira/browse/CALCITE-3423
> Project: Calcite
> Issue Type: New Feature
> Reporter: Wang Yanlin
> Priority: Major
>
> Currently, using bool type or cast operation in table macro, got exception.
> Add the code snippet below in *JdbcTest* to reproduce.
>
> {code:java}
> // check for cast
> resultSet = connection.createStatement().executeQuery(
> "select * from table(\"s\".\"Str\"(MAP['a', 1, 'baz', 2], cast(1 as
> bigint))) as t(n)");
> assertThat(CalciteAssert.toString(resultSet),
> equalTo("N={'a'=1, 'baz'=2}\n"
> + "N=1 \n"));
> // check for bool type
> resultSet = connection.createStatement().executeQuery(
> "select * from table(\"s\".\"Str\"(MAP['a', 1, 'baz', 2], true)) as
> t(n)");
> assertThat(CalciteAssert.toString(resultSet),
> equalTo("N={'a'=1, 'baz'=2}\n"
> + "N=true \n"));
> // check for nested cast
> resultSet = connection.createStatement().executeQuery(
> "select * from table(\"s\".\"Str\"(MAP['a', 1, 'baz', 2],"
> + "cast(cast(1 as int) as varchar(1)))) as t(n)");
> assertThat(CalciteAssert.toString(resultSet),
> equalTo("N={'a'=1, 'baz'=2}\n"
> + "N=1 \n"));
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)