The following should do it

select cast(_MAP['POP'] as integer) from "elasticsearch".zips

In the test of the adapter you can see other usages:

https://github.com/apache/calcite/blob/cc20ca13db4d506d9d4d1b861dd1c7ac3944e56e/elasticsearch2/src/test/resources/elasticsearch-zips-model.json#L37


Mit freundlichen Grüßen,
------------------------------------------------------------------------
*Christian Beikov*
Am 09.10.2017 um 19:40 schrieb AshwinKumar AshwinKumar:
Hi Team,

Could you please help here. I am stuck on this problem for like 2 days now.

Thanks,
Ashwin

On Mon, Oct 9, 2017 at 4:42 PM, AshwinKumar AshwinKumar <
[email protected]> wrote:

Hi Team,

I have an elasticsearch view called zips . Below is the table data -

0: jdbc:calcite:model=./elasticsearch2/src/te> select POP from
"elasticsearch".ZIPS;
+----------------------+
|         POP          |
+----------------------+
| {POP=13367}          |
| {POP=1652}           |
| {POP=3184}           |
| {POP=43704}          |
| {POP=2084}           |
| {POP=1350}           |
| {POP=8194}           |
| {POP=1732}           |
| {POP=9808}           |
| {POP=4441}           |
+----------------------+
10 rows selected (0.319 seconds)

Could you please let me know if there is a way to select only the values
in POP field using SQL. Like for eg I need only the integer values like
13367,1652 and so on from the tables. I need to join these values with
another table in postgres schema.

Thanks,
Ashwin


Reply via email to