Use this resource to preview data during mapping design. By default, the response returns up to ten rows of data for the specified object.
GET request
To request preview data, specify the connection ID or connection name and the object name in the URI. Optionally, you can include field format information in the request.
Use one of the following URIs:
•To request source data, use one of the following URIs:
You can receive field metadata in the response for flat file, Avro, Parquet, Orc, or JSON formats. To receive field metadata, include file format information in the request body.
For flat file format, you can include the following information in the flatFileAttrs object:
Field
Type
Required
Description
id
Long
Yes
Field ID.
delimiter
String
Yes
Character used to separate fields.
textQualifier
String
Yes
Quote character that defines the boundaries of text strings.
escapeChar
String
Yes
Character immediately preceding a field delimiter character embedded in an unquoted string, or immediately preceding the quote character in a quoted string.
headerLineNo
Int
Yes
Number of header lines.
firstDataRow
Int
Yes
The row number where the data begins in the file.
rowDelimiter
Int
--
Line break character. Enter the decimal code for an ASCII character between 1 and 32.
Default is 10, which is the line feed character.
consecutiveDelimiter
Boolean
--
Indicates whether one or more consecutive delimiters are treated as one.
Default is false.
multiDelimitersAsAnd
Boolean
--
If the delimiter you specify is more than one character, indicates whether the characters are treated as a single delimiter or multiple delimiters.
Default is true.
For Avro, Parquet, Orc, or JSON formats, include the following information in the dataFormat object:
Field
Type
Required
Description
formatId
String
Yes
Format type, for example, Avro.
schema
String
--
Schema format.
By default, the dataPreview response returns 10 rows. For flat file connections, you can specify the number of rows using the numRows parameter as shown in the following example:
/api/v2/connection/source/<id>/datapreview/?objectName=<object name>&numRows=<number of rows to view>
You can also specify the beginning row using the startRowNum parameter as shown in the following example:
/api/v2/connection/source/<id>/datapreview/?objectName=<object name>&startRowNum=<row number of row to begin with>
Note: If you use the connection name in the URI and the connection name includes a space, replace the space with %20. For example: