Invoking a Procedure

GemFire XD uses an extended CALL syntax for invoking data-aware procedures.

The GemFire XD syntax for invoking a procedure is:
CALL procedure_name
 ( [ expression [, expression ]* ] )
 [ WITH RESULT PROCESSOR processor_class ]
 [ { ON TABLE table_name [ WHERE whereClause ] }
   |
   { ON { ALL | SERVER GROUPS (server_group_name [, server_group_name]* ) } }
 ]
Use the optional ON and WHERE clauses to provide routing hints to the GemFire XD engine, in order to prune the procedure execution to a subset of GemFire XD members:
  • ON TABLE executes the procedure code on GemFire XD members that host data for the table. With partitioned tables, you can also use the WHERE clause to further specify only those members host specific data values for the table.

    Note that both the ON TABLE and WHERE clauses are only used to prune procedure execution to specific members; the clauses do not limit the data results, and neither the ON TABLE nor the WHERE clause restriction is applied to queries within the procedure body.

  • ON ALL executes the procedure code on all GemFire XD members, while ON SERVER GROUPS executes the procedure code on one or more named server groups.
Note: Specifying ON TABLE, ON ALL, and ON SERVER groups also affects the scoping of nested queries within the procedure implementation. See Populating Result Sets and Using the <local> and <global> Escape Syntax with Nested Queries for more information.

If you omit the ON clause, GemFire XD executes the procedure as a data-independent procedure on the local, coordinating member.

If you omit the WITH RESULT PROCESSOR clause when calling a data-aware procedure, then GemFire XD uses a default result processor implementation.

If the called procedure does not specify an OUT parameter or result set, then GemFire XD calls the procedure asynchronously, without waiting for a reply. GemFire XD logs any error that occurs during procedure execution.