Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何仅从MYSQL数据库捕获新记录_Python_Mysql_Airflow - Fatal编程技术网

Python 如何仅从MYSQL数据库捕获新记录

Python 如何仅从MYSQL数据库捕获新记录,python,mysql,airflow,Python,Mysql,Airflow,我试图从MYSQL数据库中只捕获新记录,因此我只能选择这些记录并将它们作为.csv文件发送到S3存储桶。是否有任何方法或mysql函数可以保存每条记录的时间戳?我正在尝试从mysql到s3的增量加载 有什么想法或建议吗?MySQL中默认没有行级时间戳 一种解决方案是创建自己的,方法是在相关表中添加一列,并启用默认值和更新选项: alter table mytable add ts timestamp default current_timestamp on update cu

我试图从MYSQL数据库中只捕获新记录,因此我只能选择这些记录并将它们作为.csv文件发送到S3存储桶。是否有任何方法或mysql函数可以保存每条记录的时间戳?我正在尝试从mysql到s3的增量加载


有什么想法或建议吗?

MySQL中默认没有行级时间戳

一种解决方案是创建自己的,方法是在相关表中添加一列,并启用
默认值
更新选项:

alter table mytable add ts timestamp 
    default current_timestamp 
    on update current_timestamp
;