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

Support query arrays of Embedded Documents in MongoDB adapter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mongodb-adapter
    • Labels:
      None

      Description

      With CALCITE-194 it will be possible to SELECT elements of arrays. 

      Would be great to support WHERE clauses for arrays especially for arrays of embedded documents.

       

      I tried it with the fix from CALCITE-194

        {
          "name": "ZIPS",
          "type": "view",
          "sql": "select cast(_MAP['city'] AS varchar(20)) AS city,\n cast(_MAP['loc'][0] AS float) AS longitude, cast(_MAP['loc'][1] AS float) AS latitude, cast(_MAP['pop'] AS integer) AS pop, cast(_MAP['state'] AS varchar(2)) AS state, cast(_MAP['_id'] AS varchar(5)) AS id from \"mongo_raw\".\"zips\""
         }
      
       Select longitude from zips where longitude = -71.425486
      

      Mongo Adapter Exception

      java.lang.AssertionError: cannot translate op null call =(CAST(CAST(ITEM(ITEM($0, 'loc'), 0)):FLOAT):DOUBLE, -71.425486)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dearnley Martin Dearnley
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: