首页 > 解决方案 > NiFi CaptureChangeMySQL 将 varchar 列转换为空值

问题描述

我对 Apache NiFi 1.12.1 有疑问。对于一些我不知道的原因 CaptureChangeMySQL 返回许多空值。基本上,只有 int 的列才返回正确的值。我是使用 NiFi 的新手,所以我可能会错过配置中的一些明显的东西。

我有下表:

create table inventory.abc
(
    id int auto_increment
        primary key,
    first_name varchar(100) not null,
    last_name varchar(100) not null,
    age int not null
);

处理器配置: 在此处输入图像描述

Bin 日志设置:

mysql> show variables like '%bin%';
+--------------------------------------------+--------------------------------+
| Variable_name                              | Value                          |
+--------------------------------------------+--------------------------------+
| bind_address                               | *                              |
| binlog_cache_size                          | 32768                          |
| binlog_checksum                            | CRC32                          |
| binlog_direct_non_transactional_updates    | OFF                            |
| binlog_error_action                        | ABORT_SERVER                   |
| binlog_format                              | ROW                            |
| binlog_group_commit_sync_delay             | 0                              |
| binlog_group_commit_sync_no_delay_count    | 0                              |
| binlog_gtid_simple_recovery                | ON                             |
| binlog_max_flush_queue_time                | 0                              |
| binlog_order_commits                       | ON                             |
| binlog_row_image                           | FULL                           |
| binlog_rows_query_log_events               | OFF                            |
| binlog_stmt_cache_size                     | 32768                          |
| binlog_transaction_dependency_history_size | 25000                          |
| binlog_transaction_dependency_tracking     | COMMIT_ORDER                   |
| innodb_api_enable_binlog                   | OFF                            |
| innodb_locks_unsafe_for_binlog             | OFF                            |
| log_bin                                    | ON                             |
| log_bin_basename                           | /var/lib/mysql/mysql-bin       |
| log_bin_index                              | /var/lib/mysql/mysql-bin.index |
| log_bin_trust_function_creators            | OFF                            |
| log_bin_use_v1_row_events                  | OFF                            |
| log_statements_unsafe_for_binlog           | ON                             |
| max_binlog_cache_size                      | 18446744073709547520           |
| max_binlog_size                            | 1073741824                     |
| max_binlog_stmt_cache_size                 | 18446744073709547520           |
| sql_log_bin                                | ON                             |
| sync_binlog                                | 1                              |
+--------------------------------------------+--------------------------------+
29 rows in set (0.00 sec)

我得到这样的结果: 在此处输入图像描述

知道为什么我在输出中得到这么多空值吗?我认为这可能与Distributed Map Cache Client但由于此选项不是强制性的,我认为这不是问题。

标签: apache-nifi

解决方案


推荐阅读