Setting the deserialization policy in DDL

Set the deserialization policy in the WITH clause of a Kafka table with the deserialization.failure.policy option.

For the same setting in the Kafka table editor, see Handling deserialization errors.

Table 1. Deserialization options
Option Value Behavior
deserialization.failure.policy fail The default. The job fails with an exception.
ignore The record is skipped without a log entry.
ignore_and_log The record is skipped and logged.
dlq The record is written to a DLQ topic.
deserialization.failure.dlq.topic A topic name Required when the policy is dlq. Without it, the job fails with Kafka Table set to use Dead Letter Queue, but no topic specified.
  1. In the Streaming SQL Console, click Projects in the left navigation pane, and click the name of your project.
    The project opens, with the Explorer panel on the left. To open the Streaming SQL Console, see Accessing Cloudera SQL Stream Builder.
  2. In the Explorer, open the menu of Jobs, and click New Job.
    The Create New Job window opens.
  3. Enter a Job Name, or click Generate Job Name.
  4. Click Create.
    The job opens in a new tab, with an empty SQL editor.
  5. Enter the CREATE TABLE statement for the Kafka table, or paste the DDL of an existing table.
  6. Add the options to the WITH clause.
    For example:
    'deserialization.failure.policy' = 'dlq',
    'deserialization.failure.dlq.topic' = 'bad_records'
  7. Click the Execute job icon.