Pinot:可读日期时间格式的架构

发布于 2025-01-14 04:01:36 字数 151 浏览 0 评论 0原文

我正在将卡夫卡的实时数据消耗到皮诺中。数据的日期时间格式如下:

“Mon Mar 14 15:58:24 IST 2022”

我正在努力在架构文件中写入“dateTimeFieldSpecs”。 你能帮我一下吗?

谢谢,

苏库马尔

I am consuming real time data of kafka into pinot. Date time format of data is given below:

"Mon Mar 14 15:58:24 IST 2022"

I am struggling to write "dateTimeFieldSpecs" in schema file.
Can you please help me out.

Thanks,

Sukumar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

后来的我们 2025-01-21 04:01:36

您可以使用转换函数来为您做到这一点。

首先将该列添加到常规 schema.json 中。之后,在表设置中添加一个转换函数,通常是table.json。该函数接受原始列并将其重新格式化为 Pinot 的类型。

但请记住,可能有必要检查服务器与本地时区,尤其是在实时表中。

查看这些文档

希望这有帮助!

you can use the transformation functions to do that for you.

First add the column to your regular schema.json. After that, add a transformation function to the table settings, usually, table.json. This function takes in the original column and re-formats it to Pinot's type.

Bare in mind though, it may be necessary to check server vs. local time zones, especially in real-time tables.

Check out these docs

Hope this helps!

眉目亦如画i 2025-01-21 04:01:36

至少配置下面有两个选项对应于格式 yyyy-MM-ddTHH:mm:ss.SSSZ 的字段:

  1. 您可以将此字段定义为维度一:
    {
        "name": "Date1",
        "dataType": "TIMESTAMP"
    }
]
  1. 将字段定义为 dateTime:
"dateTimeFieldSpec": [
        {
            "name": "DateFeild",
            "dataType": "TIMESTAMP",
            "format": "1:MILLISECONDS:EPOCH",
            "granularity": "1:DAYS"
        }
    ]

添加转换函数到表配置:

"transformConfig": [
    {
        "columnName": "DateFeild",
        "transformFunction": "FromDateTime(\"Date1\", 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z')"
    }
]

at least you have two options below config corresponds to field in format yyyy-MM-ddTHH:mm:ss.SSSZ:

  1. you can define this field as dimension one:
    {
        "name": "Date1",
        "dataType": "TIMESTAMP"
    }
]
  1. define field as dateTime:
"dateTimeFieldSpec": [
        {
            "name": "DateFeild",
            "dataType": "TIMESTAMP",
            "format": "1:MILLISECONDS:EPOCH",
            "granularity": "1:DAYS"
        }
    ]

with transform function added to table config:

"transformConfig": [
    {
        "columnName": "DateFeild",
        "transformFunction": "FromDateTime(\"Date1\", 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z')"
    }
]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文