Back to Tdengine

Flink Common Info

docs/en/assets/resources/_flink-common-info.mdx

latest7.4 KB
Original Source

Version History

Flink Connector VersionMajor ChangesTDengine TSDB-Enterprise Version
2.1.4Upgrade the JDBC driver to version 3.7.3. For details, see JDBC Version History-
2.1.3Add exception information output for data conversion.-
2.1.2Add backtick filtering for written fields.-
2.1.1Fix the issue of data binding failure for the same table in Stmt.-
2.1.0Fix the issue of writing varchar types from different data sources.-
2.0.2The Table Sink supports types such as RowKind.UPDATE_BEFORE, RowKind.UPDATE_AFTER, and RowKind.DELETE.-
2.0.1Sink supports writing types from Rowdata implementations.-
2.0.01.Sink supports custom data structure serialization and writing to TDengine.
  1. Supports writing to TDengine database using Table SQL. | 3.3.5.1 and higher | | 1.0.0 | Support Sink function to write data from other sources to TDengine in the future. | 3.3.2.0 and higher |

Exception and error codes

After the task execution fails, check the Flink task execution log to confirm the reason for the failure Please refer to:

Error CodeDescriptionSuggested Actions
0xa000connection param errorConnector parameter error.
0xa010database name configuration errordatabase name configuration error.
0xa011table name configuration errorTable name configuration error.
0xa013value.deserializer parameter not setNo serialization method set.
0xa014list of column names set incorrectlyList of column names for target table not set.
0x2301connection already closedThe connection has been closed. Check the connection status or create a new connection to execute the relevant instructions.
0x2302this operation is NOT supported currentlyThe current interface is not supported, you can switch to other connection methods.
0x2303invalid variablesThe parameter is invalid. Please check the corresponding interface specification and adjust the parameter type and size.
0x2304statement is closedStatement has already been closed. Please check if the statement is closed and reused, or if the connection is working properly.
0x2305resultSet is closedThe ResultSet has been released. Please check if the ResultSet has been released and used again.
0x230dparameter index out of rangeparameter out of range, please check the reasonable range of the parameter.
0x230econnection already closedThe connection has been closed. Please check if the connection is closed and used again, or if the connection is working properly.
0x230funknown SQL type in TDenginePlease check the Data Type types supported by TDengine.
0x2315unknown tao type in TDengineDid the correct TDengine data type be specified when converting TDengine data type to JDBC data type.
0x2319user is requiredUsername information is missing when creating a connection.
0x231apassword is requiredPassword information is missing when creating a connection.
0x231dcan't create connection with server withinIncrease connection time by adding the parameter httpConnectTimeout, or check the connection status with taosAdapter.
0x231efailed to complete the task within the specified timeIncrease execution time by adding the parameter messageWaitTimeout, or check the connection with taosAdapter.
0x2352unsupported encodingAn unsupported character encoding set was specified under the local connection.
0x2353internal error of database, Please see taoslog for more detailsAn error occurred while executing prepareStatement on the local connection. Please check the taoslog for problem localization.
0x2354connection is NULLConnection has already been closed while executing the command on the local connection. Please check the connection with TDengine.
0x2355result set is NULLLocal connection to obtain result set, result set exception, please check connection status and retry.
0x2356invalid num of fieldsThe meta information obtained from the local connection result set does not match.

Data type mapping

TDengine currently supports timestamp, number, character, and boolean types, and the corresponding type conversions with Flink RowData Type are as follows:

TDengine DataTypeFlink RowDataType
TIMESTAMPTimestampData
INTInteger
BIGINTLong
FLOATFloat
DOUBLEDouble
SMALLINTShort
TINYINTByte
BOOLBoolean
VARCHARStringData
BINARYStringData
NCHARStringData
JSONStringData
VARBINARYbyte[]
GEOMETRYbyte[]

Instructions for use

The semantic reason for using At-Least-Once is:

  • TDengine currently does not support transactions and cannot perform frequent checkpoint operations and complex transaction coordination.
  • Due to TDengine's use of timestamps as primary keys, downstream operators of duplicate data can perform filtering operations to avoid duplicate calculations.
  • Using At-Least-Once to ensure high data processing performance and low data latency, the setting method is as follows:

Instructions:

java
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.enableCheckpointing(5000);
env.getCheckpointConfig().setCheckpointingMode(CheckpointingMode.AT_LEAST_ONCE);

If using Maven to manage a project, simply add the following dependencies in pom.xml.

xml
<dependency>
    <groupId>com.taosdata.flink</groupId>
    <artifactId>flink-connector-tdengine</artifactId>
    <version>2.1.4</version>
</dependency>