Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/264.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
Azure cosmosdb SQL Server Polybase | Cosmos文档数据库日期转换问题_Azure Cosmosdb_Polybase_Sql Server 2019 - Fatal编程技术网

Azure cosmosdb SQL Server Polybase | Cosmos文档数据库日期转换问题

Azure cosmosdb SQL Server Polybase | Cosmos文档数据库日期转换问题,azure-cosmosdb,polybase,sql-server-2019,Azure Cosmosdb,Polybase,Sql Server 2019,我是polybase的新手。我已经将我的SQL 2019服务器链接到第三方Azure cosmos,并且我能够从我的集合中查询数据。但是,当我试图查询日期字段时,我发现了一个错误。在文件中,日期定义为: "created" : { "$date" : 1579540834768 }, 在我的外部表中,我将列定义为 [created] DATE, 我曾尝试将列创建为int和nvarchar(128),但每次模式检测都会拒绝它。(我试图创建一个字段created_date,但模式检测也不

我是polybase的新手。我已经将我的SQL 2019服务器链接到第三方Azure cosmos,并且我能够从我的集合中查询数据。但是,当我试图查询日期字段时,我发现了一个错误。在文件中,日期定义为:

"created" : {
    "$date" : 1579540834768
},
在我的外部表中,我将列定义为

[created] DATE,
我曾尝试将列创建为int和nvarchar(128),但每次模式检测都会拒绝它。(我试图创建一个字段created_date,但模式检测也不同意,因为这是正确的

当我尝试返回任何日期字段的查询时,会出现以下错误:

Msg 105082, Level 16, State 1, Line 8
105082;Generic ODBC error: [Microsoft][Support] (40460) Fractional data truncated while performing conversion. .
OLE DB provider "MSOLEDBSQL" for linked server "(null)" returned message "Unspecified error".
Msg 7421, Level 16, State 2, Line 8
Cannot fetch the rowset from OLE DB provider "MSOLEDBSQL" for linked server "(null)". .
如果我尝试在查询中排除空值,则会发生这种情况,即使在筛选到填充日期的特定记录时也是如此(使用Azure门户界面验证)


我应该做些什么来处理json记录中的整数日期;或者我可以使用另一种类型来让外部表工作?

找到了一个解决方案。SQL Server在架构中为mongodb日期建议了错误的类型。使用DateTime2解决了问题。在msdn中的a上找到了这个问题。

酷,是的,日期总是一个问题。你知道吗甲骨文也是如此。