Determine HDFS output format - connect_cdc_sqdata - Latest

Connect CDC (SQData) HDFS Quickstart

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (SQData)
Version
Latest
Language
English
Product name
Connect CDC (SQData)
Title
Connect CDC (SQData) HDFS Quickstart
Copyright
2024
First publish date
2000
Last edition
2024-07-30
Last publish date
2024-07-30T20:10:32.610182

SQData supports a variety of target formats for HDFS output file(s), including JSON, AVRO, XML and delimited. JSON is the preferred format for streaming changed data (CDC), as it is self-described and is not as heavy payload-wise as XML.

With JSON output, you have the option of replicating an entire source record/row, including the before and after image for updates, without any mapping. This is performed via the REPLICATE function. An example of this is provided later in this document.

You also have the option of customizing your output with the source to target mapping and dynamic construction of a JSON (or another format) message using the PRINTF function. Please note that the scope of this document is not intended to discuss custom JSON. Please visit Precisely https://www.precisely.com/support for assistance with this type of processing.

Syntax
DATASTORE hdfs://%(HHOST):%(HPORT)/DUMMY
 OF JSON -- specify JSON format
 AS TARGET
 DESCRIBED BY GROUP DB2_SOURCE -- use source for REPLICATE
 STAGING SIZE 4G -- file size
 STAGING DELAY 60 -- rotate every 60 minutes
;

Sample JSON output
{“object_name”:SQDATA.EMPLOYEE,
"stck":"00d16918eb93309dc0",
"timestamp":"2018-06-01-13.18.41.780264",
"change_op":"U",
"after_image":
{
"empno":“000010”,
"firstnme":“SANDRA”,
”midinit":“i”,
“lastname”:“HAAS”,
“workdept”:“A00”,
“phoneno":"3978",
"hiredate":"1978-09-15",
"job":"PRES",
"edlevel":14,
"sex":"f",
"birthdate":"1954-03-31",
"salary":59250.00,
"bonus":6600.00,
"comm":2340.00
},
"before_image":
{
"empno":“000010”,
"firstnme":“CHRISTINE”,
”midinit":“I”,
“lastname”:“HAAS”,
“workdept”:“A00”,
“phoneno":"3978",
"hiredate":"1978-09-15",
"job":"PRES",
"edlevel":14,
"sex":"f",
"birthdate":"1954-03-31",
"salary":59250.00,
"bonus":6600.00,
"comm":2340.00
},
}
Note: Both JSON and AVRO formatted records are always in Unicode (UTF-8) with the translation from the source codepage/CCSID (i.e. EBCIDC/1047) performed automatically by the SQData Apply engine.