[
https://issues.apache.org/jira/browse/CALCITE-3056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrei Sereda resolved CALCITE-3056.
------------------------------------
Resolution: Fixed
Fixed in
[ac1a6c2d3b6|https://github.com/apache/calcite/pull/1201/commits/ac1a6c2d3b67e075848b4d381558d4f6b62d2c83]
> Elasticsearch adapter. Invalid result with cast function on raw queries
> -----------------------------------------------------------------------
>
> Key: CALCITE-3056
> URL: https://issues.apache.org/jira/browse/CALCITE-3056
> Project: Calcite
> Issue Type: Bug
> Components: elasticsearch-adapter
> Affects Versions: 1.19.0
> Reporter: Andrei Sereda
> Assignee: Andrei Sereda
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Raw elastic queries (not based on views) return incorrect result when
> {{cast}} function is used.
> {code:sql}
> -- does not work without view (returns null)
> select max(cast(_MAP['foo'] as integer)) from elastic
> -- query based on view works
> create view elasticview as select cast(_MAP['foo'] as integer) as foo from
> elastic;
> -- works
> select max(foo) from elasticview
> {code}
> This seems a little counterintuitive, since casting is not pushed to elastic,
> but consistent with existing view functionality.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)