Table Messages
A table message is an SAP Data Intelligence Modeler message that represents tabular data. The port type for table messages is message.table.
Attributes
|
Property |
Description |
|---|---|
|
version (required) |
Version of the table message type expressed as an integer. |
|
name |
Name of the table expressed as a string, such as the name of the database from which it came. If the name is case-insensitive, you must enter it in all uppercase letters. Otherwise, you must use the actual casing. |
|
columns |
Objects that describe each column of the table, expressed in an array. Each object has the following properties:
|
|
primaryKey |
Name of the primary key column expressed as a string, or an array of column names for a compound key. |
Body
The message body must be an array of arrays of generic elements using Go language: [][]interface{}. The data in the body must always be row based. All rows must contain the same number of values.
Supported Types
The term “class” refers to a group of similar column types commonly found in database management systems and file formats. For example, the string class can be found in the form of SQL types, such as VARCHAR and ALPHANUM.
|
Type Class |
Data Type |
String Format |
|---|---|---|
|
timestamp |
string |
RFC 3339
RFC 3339 includes a numeric time zone (or Z for UTC) and an optional value of nanoseconds.
Columns that store only part of a timestamp must leave the unused portion at the zero value (midnight for the time and 0000-01-01 for the date). |
|
integer |
int |
integer |
|
decimal |
int / float64/ string |
Decimal number with a dot as the separator or a fraction (numerator/denominator). You can suffix the int with the letter e followed by an exponent.
Provide the value for a decimal by direct integer/float representation or as a string encapsulating a valid number.
|
|
float |
float64 |
Decimal number with a dot as the separator or a fraction (numerator/denominator). You can suffix the int with the letter e followed by an exponent.
|
|
string |
string |
N/A |
|
binary |
[]byte |
Base 64 (RFC 4648, padded) |
|
bool |
bool |
1, t, T, TRUE, true, True, 0, f, F, FALSE, false, or False |
When a column's class is unknown, the engine can leave the operators' values as strings. Later in the graph, if a particular class is expected for that column, it's possible to choose to convert its values. In this case, the operator engine understands that the string is in the format specified under the String format column in the table. For example, when the operator is reading from a CSV file to insert its data into an existing database table: Column classes are unknown when parsing CSV, but some database operators require the table schema from the server and treat each column accordingly.
Encoding
Even if an operator input is a general type of message.* or any.*, you must set the encoding to table so that operators can detect a table message.