Hello, guys.

I working on support of saving Spark DataFrame to Ignite [1].

I want to execute "DROP TABLE XXX" query.
To execute some SQL query in regulary way one need some cache.
That cache has to differs from table cache to execute "DROP TABLE" successfully.

I founded 3 different ways to execute SQL query without explicit cache name.
Please, tell me which way is right?
Do we need all 3 way to make a query?

1. JdbcRequestHandler - [2]

```

    private final GridKernalContext ctx;
...
    List<FieldsQueryCursor<List<?>>> results = ctx.query().querySqlFields(qry, 
true, protocolVer.compareTo(VER_2_3_0) < 0);

```

2. GridCacheProcessor - [3]

```

    /**
    * Gets public cache that can be used for query execution.
    * If cache isn't created on current node it will be started.        
    */
    public IgniteCacheProxy<?, ?> getOrStartPublicCache(boolean start, boolean 
inclLoc) throws IgniteCheckedException {

```

3. QueryCommandHandler - [4]

```

        protected static final String DFLT_CACHE_NAME = "default";
...     
        String cacheName = req.cacheName() == null ? DFLT_CACHE_NAME : 
req.cacheName();

```


[1] https://issues.apache.org/jira/browse/IGNITE-7337
[2] 
https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java#L310
[3] 
https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java#L1648
 
[4] 
https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java#L318

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to