Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3056

Elasticsearch adapter. Invalid result with cast function on raw queries

    XMLWordPrintableJSON

    Details

      Description

      Raw elastic queries (not based on views) return incorrect result when cast function is used.

      
      -- 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 
      

      This seems a little counterintuitive, since casting is not pushed to elastic, but consistent with existing view functionality.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sereda Andrei Sereda
                Reporter:
                sereda Andrei Sereda
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m