CreateSchema
Creates a schema definition that maps a Kafka topic to a relational table structure. This stored procedure is typically used to establish a structured representation of message data so that the topic can be queried or transformed using SQL-like operations.
CreateSchema
Creates a local schema file (.rsd) from an existing table or view in the data model.
The schema file is created in the directory set in the Location connection property when this procedure is executed. You can edit the file to include or exclude columns, rename columns, or adjust column datatypes.
The driver checks the Location to determine if the names of any .rsd files match a table or view in the data model. If there is a duplicate, the schema file will take precedence over the default instance of this table in the data model. If a schema file is present in Location that does not match an existing table or view, a new table or view entry is added to the data model of the driver.
Input
| Name | Type | Required | Accepts Output Streams | Description |
| TableName | String | True | False | Specifies the name of the table for which the schema definition is created. This input determines the table structure that the stored procedure uses to generate the corresponding schema file. |
| FileName | String | False | False | Specifies the full file path and name of the schema file to generate (for example, 'C:\\Users\\User\\Desktop\\ApacheKafka\\company.rsd'). This input is required when you want the generated schema to be saved directly to a file. |
| FileStream | String | False | True | Specifies the stream to which the generated schema definition is written. This input is used when the schema should be processed or saved programmatically rather than written to a file path. |
Result Set Columns
| Name | Type | Description |
| Result | String | Returns a value of 'true' when the stored procedure successfully generates and writes the schema and a value of 'false' when the operation fails due to missing parameters or write-access issues. |
| FileData | String | Returns the generated schema definition in Base64-encoded format. This output is populated only when the FileName and FileStream inputs are not provided, allowing the schema to be retrieved directly from the stored procedure response. |