Class SqlQueriesExample
- java.lang.Object
-
- org.apache.ignite.examples.sql.SqlQueriesExample
-
public class SqlQueriesExample extends java.lang.ObjectSQL queries example with the usage of Java SQL API.Example also demonstrates usage of fields queries that return only required fields instead of whole key-value pairs. When fields queries are distributed across several nodes, they may not work as expected. Keep in mind following limitations (not applied if data is queried from one node only and for Calcite-based query engine):
-
Non-distributed joins will work correctly only if joined objects are stored in
collocated mode. Refer to
AffinityKeyjavadoc for more details.To use distributed joins it is necessary to set query 'distributedJoin' flag using
SqlFieldsQuery.setDistributedJoins(boolean). - Note that if you created query on to replicated cache, all data will be queried only on one node, not depending on what caches participate in the query (some data from partitioned cache can be lost). And visa versa, if you created it on partitioned cache, data from replicated caches will be duplicated.
Remote nodes should be started using
ExampleNodeStartupwhich will start node withexamples/config/example-ignite.xmlconfiguration.To run this example on the Calcite-based SQL engine, modify
examples/config/example-sql.xmlfile and setCalciteQueryEngineConfigurationas default. -
Non-distributed joins will work correctly only if joined objects are stored in
collocated mode. Refer to
-
-
Constructor Summary
Constructors Constructor Description SqlQueriesExample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Executes example.
-