Generates the text query string for the foreign server and returns the interface version that is currently supported. The method returns a string which contains the external query.
This routine is callable on a PE vproc only by a table operator.
Syntax
public String getExternalQuery( ColumnDefinition[] colDefs, ServerType serverType, ExtOpSetType[] extOpSetTypes, int[] interfaceVersions) throws SQLException
Syntax Elements
- colDefs
- A list of column definitions.
- serverType
- ServerType is defined as follows:
public enum ServerType { ANSISQL(0), HADOOP(1); }
- extOpSetTypes
- A set of valid operators supported on the foreign server.
- interfaceVersions
- The caller passes in the desired interface version as the argument.
- The routine returns the actual interface version that is currently supported.
Example: Calling getExternalQuery
ServerType sType = ServerType.ANSISQL; ExtOpSetType extOpTypes[] = new ExtOpSetType[3]; extOpTypes[0] = ExtOpSetType.Eq_ET; extOpTypes[1] = ExtOpSetType.And_ET; extOpTypes[2] = ExtOpSetType.Or_ET; int[] versions = new int[2]; versions[0] = 1; // The caller passes in the desired interface version. String extQuery = contract.getExternalQuery(colDefs, sType, extOpTypes, versions);
After calling getExternalQuery, versions[1] will contain the actual interface version that is currently supported on the system.