如果表具有日期时间偏移值,则 ExecuteSQL 不选择表? [英] ExecuteSQL doesn't select table if it having dateTime Offset value?

查看:23
本文介绍了如果表具有日期时间偏移值,则 ExecuteSQL 不选择表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了具有数据类型 -dateTimeOffset 值的单列的表并插入了一些值.

I have created table with single column having data type -dateTimeOffset value and inserted some values.

create table dto (dto datetimeoffset(7))
insert into dto values (GETDATE()) -- inserts date and time with 0 offset
insert into dto values (SYSDATETIMEOFFSET()) -- current date time and offset
insert into dto values ('20131114 08:54:00 +10:00') -- manual way

在 Nifi 中,我在 Execute SQL 中指定了 "Select * from dto" 查询.

In Nifi,i have specified "Select * from dto" query in Execute SQL .

它显示以下错误..,

java.lang.IllegalArgumentException: createSchema: Unknown SQL type -155 cannot be converted to Avro type

如果我将该列更改为 dateTime,则 ExecuteSQL 运行正常,但它在 DateTimeOffset 列中不起作用.

If i change that column into dateTime then ExecuteSQL runs correctly but it doesn't worked in DateTimeOffset column.

感谢任何帮助.

非常感谢

推荐答案

datetimeoffset 是 MSSQL 特定的 JDBC 类型 并且不受 ExecuteSQL 支持(它支持 标准 JDBC 类型).您可以尝试将 datetimeoffset 字段转换为其他一些标准类型,例如日期时间,如 此处.

datetimeoffset is a MSSQL-specific JDBC type and is not supported by ExecuteSQL (which supports the standard JDBC types). You could try to cast the datetimeoffset field into some other standard type such as datetime, as described here.

这篇关于如果表具有日期时间偏移值,则 ExecuteSQL 不选择表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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