Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.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
Apache kafka secor忽略message.timestamp.input.pattern_Apache Kafka_Google Bigquery_Google Cloud Storage_Pinterest - Fatal编程技术网

Apache kafka secor忽略message.timestamp.input.pattern

Apache kafka secor忽略message.timestamp.input.pattern,apache-kafka,google-bigquery,google-cloud-storage,pinterest,Apache Kafka,Google Bigquery,Google Cloud Storage,Pinterest,我正在尝试使用pinterest secor将数据从google云存储加载到big query,但big query使用时间戳,如2019-08-16 15:30:00,而secor JsonMessageParser使用长整数值big query可以使用整数,但由于某些原因,在尝试将整数时间戳加载到big query时,它将秒转换为微秒,再加上6个零,然后抱怨时间戳超出范围 设置为秒或: # Name of field that contains a timestamp, as a date

我正在尝试使用pinterest secor将数据从google云存储加载到big query,但big query使用时间戳,如2019-08-16 15:30:00,而secor JsonMessageParser使用长整数值big query可以使用整数,但由于某些原因,在尝试将整数时间戳加载到big query时,它将秒转换为微秒,再加上6个零,然后抱怨时间戳超出范围

设置为秒或:

# Name of field that contains a timestamp, as a date Format, for JSON. (2014-08-07, Jul 23 02:16:57 2005, etc...)
# Should be used when there is no timestamp in a Long format. Also ignore time zones.
message.timestamp.input.pattern=ts
不执行任何操作,没有message.timestamp.name字段,它使用1970-01-01时间戳日期。无论我在message.timestamp.input.pattern中设置了什么,它似乎都被忽略了

将json数据加载到带有时间戳值(如2019-08-16 15:30:00)的大查询中是可行的,但我无法让secor将这些值识别为时间戳


您知道如何解决这个问题吗?

您可以编写自己的TimestamedMessageParser自定义实现。扩展该类并创建自定义类。然后跳过方法extractPartitionsMessage有效负载和parseMessage消息

在第二种方法中,从消息对象获取字节数组mPayload。这将以字节的形式显示json数据。使用任何JSON格式化程序提取时间戳。然后将时间戳更改为您想要的任何格式。然后将此json对象转换回字节数组,然后将其分配给消息对象的有效负载字节数组。
在第一种方法中,使用此更新的值根据您的要求创建分区。

您可以使用长值并验证哪个时间戳\u XXX更适合您:“timestamp\u secondsIn64\u expression”或“timestamp\u millisIn64\u expression”您可以找到文档。另外,你能提供一个长期价值的例子吗?