You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Michael Mior (JIRA)" <ji...@apache.org> on 2018/06/20 11:55:00 UTC

[jira] [Commented] (CALCITE-2371) how to perform joins in mongodb using model json in calcite

    [ https://issues.apache.org/jira/browse/CALCITE-2371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16518072#comment-16518072 ] 

Michael Mior commented on CALCITE-2371:
---------------------------------------

If you have questions about how to use Calcite, try asking on the mailing list, dev@calcite.apache.org. This bug tracker is used for reporting issues and tracking new features.

> how to perform joins in mongodb using model json in calcite
> -----------------------------------------------------------
>
>                 Key: CALCITE-2371
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2371
>             Project: Calcite
>          Issue Type: Task
>            Reporter: Subbarao
>            Assignee: Julian Hyde
>            Priority: Major
>
> Hi,
> Iam already connected mongodb using json model file in apache calcite.
> but here while executing select * from "tablename" it will be showing exceptions.
> instead of that query iam  using select  _MAP['columnname'] from 'tablename' then it will be perfectly executing .But i need to select all the columns what is the query.
> Another one is i try to perform sql joins in mongodb but it will be not working.how to acheive this task.
> {
>   "version": "1.0",
>   "defaultSchema": "MONGODATABASE",
>   "schemas": [
>     {
>        "type": "custom",
>        "name": "MONGODATABASE",
>       "factory": "org.apache.calcite.adapter.mongodb.MongoSchemaFactory",
>       "operand": {
>         "host": "loaclhost",
>         "database": "db"
>       }
>     }
>   ]
> }
>  
> java.calss file:
>             Connection connection = DriverManager.getConnection(
>                     "jdbc:calcite:model=/home/msubbarao/samplefile2/CalciteWithMongoDb/calcitewithmongo.json", info);
>                  Statement stat = connection.createStatement();
>             String sql="select * from table1 c  JOIN table2 s on c.name=s.name";
>             String sql1="selecT cast(_MAP['columnname'] AS INTEGER(20)) from  \"table\" c  ";
>            ResultSet rs = stat.executeQuery(sql);
>            
>            while(rs.next()){
>                System.out.println("-->"+rs.getString(1));
>            }
>  
>  
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)