Bookshelf Home | Contents | Index | PDF |
Siebel Analytics Server Administration Guide > Using XML as a Data Source for Analytics > Using the Siebel Analytics Server XML Gateway > Using the Data Mining AdapterThe Data Mining Adapter is an extension of the Siebel Analytics Server XML Gateway. It allows you to selectively access external data sources by calling an executable file or DLL API for each record retrieved. The Data Mining Adapter can only be used for a table in a logical join with another table acting as the driving table. The table with the Data Mining Adapter receives parameterized queries from a driving table through some logical joins. The table with the Data Mining Adapter is not a table that physically exists in a back-end database. Instead, the adapter uses the column values in the WHERE clauses of the parameterized queries as its input column parameters, and generates values for those columns (the output columns) not in the WHERE clauses. For information about how to set up the logical joins, see Specifying a Driving Table. The Data Mining Adapter has two modes of operation:
You specify one executable file or DLL for each table. The In-Process Data Mining Adapter APIThe API currently consists of only one function. It takes in the values of the input columns in the parameterized queries, plus the meta information of both the input and the output columns. On return, the API places the values of the output columns in the outputColumnValueBuffer. All buffers are allocated by the caller. Refer to the file IterativeGatewayDll.h for the definition of the datatype and structures used in this API. extern "C" ITERATIVEGATEWAYDLL_API SiebelAnalyticIterativeExecutionStatus( Table 38 provides a description of the API elements. Sample ImplementationA sample implementation of the Data Mining Adapter API is provided for all supported platforms in the Sample subdirectory of the Siebel Analytics installation folder. The following files are included in the example:
Using ValueOf() ExpressionsYou can use ValueOf() expressions in the command line arguments to pass any additional parameters to the executable file or DLL API. The following example shows how to pass a user ID and password to an executable file: executable_name valueof(USERID) valueof(PASSWORD) Specifying Column ValuesWhen you use the out-of-process mode, that is, when you specify an executable file, you can pass in the column values to the executable file by bracketing the column names with the $() marker. For example, suppose there is a table containing the columns Car_Loan, Credit, Demand, Score, and Probability. The values of the input columns Car_Loan, Credit, and Demand come from other tables through join relationships. The values of the output columns Score and Probability are to be returned by the executable file. The command line would look like the following: executable_name $(Car_Loan) $(Credit) $(Demand) Each time the executable file is called, it returns one row of column values. The column values are output in a single-line demarcated by the delimiter that you specify. By default, the executable is expected to output to the stdout. Alternatively, you can direct the Data Mining Adapter to read the output from a temporary output file passed to the executable as an argument by specifying a placeholder, $(NQ_OUT_TEMP_FILE) to which the executable outputs the result line. When the Data Mining Adapter invokes the executable, the placeholder $(NQ_OUT_TEMP_FILE) is substituted by a temporary filename generated at runtime. This is demonstrated in the following example: executable_name $(Car_Loan) $(Credit) $(Demand) $(NQ_OUT_TEMP_FILE) The values of the columns that are not inputs to the executable file will be output first, in the unsorted order in which they appear in the physical table. In the preceding example, the value of the Score column will be followed by the value of the Probability column. If the executable file outputs more column values than the number of noninput columns, the Data Mining Adapter will attempt to read the column values according to the unsorted column order of the physical table. If these are in conflict with the values of the corresponding input columns, the values returned from the executable file will be used to override the input columns. The data length of each column in the delimited query output must not exceed the size specified for that column in the physical table. Configuring the Data Mining AdapterUse this procedure to configure the Data Mining Adapter. To configure the Data Mining Adapter
|
Siebel Analytics Server Administration Guide |