Print SQL Connector

Sink

The Print connector allows for writing every row to the standard output or standard error stream.

It is designed for:

  • Easy test for streaming job.
  • Very useful in production debugging.

Four possible format options:

PrintCondition1Condition2
PRINT_IDENTIFIER:taskId> output
PRINT_IDENTIFIER providedparallelism > 1
PRINT_IDENTIFIER> output
PRINT_IDENTIFIER providedparallelism == 1
taskId> output
no PRINT_IDENTIFIER providedparallelism > 1
output
no PRINT_IDENTIFIER providedparallelism == 1

The output string format is “$row_kind(f0,f1,f2…)”, row_kind is the short string of RowKind, example is: “+I(1,1)”.

The Print connector is built-in.

Attention Print sinks print records in runtime tasks, you need to observe the task log.

How to create a Print table

  1. CREATE TABLE print_table (
  2. f0 INT,
  3. f1 INT,
  4. f2 STRING,
  5. f3 DOUBLE
  6. ) WITH (
  7. 'connector' = 'print'
  8. );

Alternatively, it may be based on an existing schema using the LIKE Clause.

  1. CREATE TABLE print_table WITH ('connector' = 'print')
  2. LIKE source_table (EXCLUDING ALL)

Connector Options

OptionRequiredDefaultTypeDescription
connector
required(none)StringSpecify what connector to use, here should be ‘print’.
print-identifier
optional(none)StringMessage that identify print and is prefixed to the output of the value.
standard-error
optionalfalseBooleanTrue, if the format should print to standard error instead of standard out.
sink.parallelism
optional(none)IntegerDefines the parallelism of the Print sink operator. By default, the parallelism is determined by the framework using the same parallelism of the upstream chained operator.