This topic describes how to use the Blackhole connector.

Background information

The Blackhole connector is used for deployment debugging and can receive all input data records. If an error is returned when you create a result table that uses another connector type, but you cannot determine whether the error is caused by a system error or an invalid setting of a parameter in the WITH clause of the result table, you can change the value of the connector parameter to blackhole and click Run. If no error is returned, the system is normal. You must check the settings of parameters in the WITH clause.

The Blackhole connector can be used in the following debugging scenarios:
  • Check whether performance consumption occurs when a deployment is in the RUNNING state. This helps reduce the impact on performance consumption when you insert data into a table.
  • Check whether the output data of user-defined functions (UDFs) is valid. You can view the output data of UDFs by using the Blackhole connector. If you use the Blackhole connector, you do not need to use a physical table to check whether the output data of UDFs is valid.
The following table describes the capabilities supported by the Blackhole connector.
ItemDescription
Table typeResult table
Running modeBatch mode and streaming mode
Data formatN/A
MetricN/A
API typeSQL API
Data update or deletion in a result tableSupported

Limits

Only Realtime Compute for Apache Flink that uses Ververica Runtime (VVR) 2.0.0 or later supports the Blackhole connector.

Syntax

CREATE TABLE blackhole_sink(
  name VARCHAR,
  score BIGINT
) WITH (
  'connector' = 'blackhole'
);
You can also create a Blackhole table by using the LIKE clause based on the existing result table schema. Sample statements:
CREATE TABLE blackhole_sink WITH ('connector' = 'blackhole')
LIKE table_source (EXCLUDING ALL);

Parameters in the WITH clause

ParameterDescriptionData typeRequiredDefault valueRemarks
connectorThe type of the result table.STRINGYesNo default valueSet the value to blackhole.

Sample code

CREATE TEMPORARY TABLE table_source(
  name VARCHAR,
  score BIGINT
) WITH (
  ...
);

CREATE TEMPORARY TABLE blackhole_sink(
  name VARCHAR,
  score BIGINT
) WITH (
  'connector' = 'blackhole'
);

INSERT INTO blackhole_sink SELECT * from table_source;