在Avro中声明简单时间戳的正确方法是什么 [英] What is the proper way to declare a simple Timestamp in Avro

查看:509
本文介绍了在Avro中声明简单时间戳的正确方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问如何在Avro中声明一个简单的时间戳.

How can we declare a simple timestamp in Avro please.

type:timestamp不起作用.所以我实际上使用了一个简单的字符串,但我希望将其作为时间戳记. (这是我的变量:27/01/1999 08:45:34)

type:timestamp doesnt work. So I actually use a simple string but I want it as a timestamp. (this is my variable: 27/01/1999 08:45:34 )

谢谢

推荐答案

使用Avro的逻辑类型:

Use Avro's logical type:

 {"name":"timestamp","type": {"type": "string", "logicalType": "timestamp-millis"}

一些有用的链接:

Avro timestamp-millis

Avro逻辑类型

Hortonworks社区问题关于Avro时间戳

这篇关于在Avro中声明简单时间戳的正确方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆