jesus... "jdbc:calcite:model=database/config.json instead of 
jdbc:calcite:database/config.json ... now its working (table found).
Did someone encounter this runtime exception before  ? It  is thrown after the 
execution of my queryCaused by: java.lang.RuntimeException: Uncompilable source 
code - incompatible types: org.apache.calcite.linq4j.Ord.OrdList<? extends E> 
cannot be converted to java.util.List<org.apache.calcite.linq4j.Ord<E>>

https://i.imgsafe.org/c0814e5291.png

Julian
 

    Julian Stenzel <[email protected]> schrieb am 9:47 Donnerstag, 
22.Dezember 2016:
 

 I'll try it, but i think that no connection to the database is established at 
all (over my java application).

 

    Julian Hyde <[email protected]> schrieb am 23:33 Mittwoch, 21.Dezember 2016:
 

 I think you should use the default lex, make sure identifiers are the correct 
case, and double-quote them in your query:

  select count(*) from “mongoDB”.”ZIPS”

If that doesn’t work I don’t know what else to do.

I’ve logged https://issues.apache.org/jira/browse/CALCITE-1549 
<https://issues.apache.org/jira/browse/CALCITE-1549> to give a more descriptive 
error message in cases like this.

Julian


> On Dec 20, 2016, at 12:45 PM, Julian Stenzel <[email protected]> 
> wrote:
> 
> i tried zips, ZIPS and every available lex. Still dont work. 
> Is my program code right ? 
> Julian 
> 
>    Julian Hyde <[email protected]> schrieb am 18:29 Dienstag, 20.Dezember 2016:
> 
> 
> Maybe the “zips” table is upper-case. If so, your SQL query should be
> 
>  select count(*) from mongoDB.ZIPS
> 
> It may not be the cause, but you should also change
> 
>  defaultSchema: ‘mongo'
> 
> to
> 
>  defaultSchema: 'mongoDB'
> 
> The difference between sqlline and Java is that sqlline is using the default 
> lexical policy (because sqlline doesn't pass a Properties object when it 
> opens a connection). If you want to use a lexical policy from sqlline, you 
> need to add “;lex=SQL_SERVER” to the connect string.
> 
> Julian
> 
> 
>> On Dec 20, 2016, at 8:24 AM, Julian Stenzel <[email protected]> 
>> wrote:
>> 
>> Hello Team,
>> atm iam trying to execute some queries in java. 
>> my code:
>> Class.forName("org.apache.calcite.jdbc.Driver");info = new 
>> Properties();info.setProperty("lex", "SQL_SERVER");
>> connection = 
>> DriverManager.getConnection("jdbc:calcite:database/config.json", 
>> info);statement = connection.createStatement();
>> ResultSet resultSet = statement.executeQuery("select count(*) from 
>> mongoDB.zips");//                                                            
>>           or select count(*) from zips
>> my config.json:
>> {  version: '1.0',  defaultSchema: 'mongo',  schemas: [    {      type: 
>> 'custom',      name: 'mongoDB',      factory: 
>> 'org.apache.calcite.adapter.mongodb.MongoSchemaFactory',      operand: {     
>>    host: 'localhost',        database: 'darwin_test',
>>              }    }  ]}
>> i encounter Caused by: 
>> org.apache.calcite.sql.validate.SqlValidatorException: Table 'mongoDB.zips' 
>> not found. The query works fine with sqlline.bat and the same config 
>> (config.json).  Am I making any obvious mistake?Thank youJulian              
>>                                                                              
>>    
>> 
>> 
> 
> 


  

   

Reply via email to