javaspring-dataignitegridgain

Why does Ignite allow SQL querying of a cache A (only) from a different cache B's Ignite Cache reference


I noticed that Ignite seems to allow SQL querying (with SqlFieldsQuery) of a cache say cache A from a different cache say cache B's IgniteCache reference.

I can understand join queries, but shouldn't Ignite validate & fail execution of SQL queries that don't operate at all on the associated Ignite Cache (the IgniteCache reference/handle on which the query is being submitted for execution)? Or am I missing something?

Thanks


Solution

  • I think it's just a historical accident. There were options like ScanQuery and SqlQuery, neither of which support joins, so it would make sense to fire them at a specific table. Then the SQL engine was added and SqlFieldsQuery was added, and it inherits from Query so it (kind of) makes sense to also execute it against a table.

    You'll notice that thin-clients have a query method at the top level rather than at the table level, and Ignite 3 has a top level ignite.sql(), so different choices were made when the option was available.