gpt4 book ai didi

azure - 将 JSON 架构插入 U-SQL 表

转载 作者:行者123 更新时间:2023-12-03 04:19:34 25 4
gpt4 key购买 nike

我想在 DataLake Analysts 工具中为我的 U-SQL 表插入 JSON 架构。这是我的 JSON 架构

DECLARE @json string=  "{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "http://getIQOS.com/IQOSAbandonedCartV1.json",
"title": "CE:I:ORD:ABC",
"type": "object",
"properties": {
"altriaOrchestrated": {
"$id": "/properties/altriaOrchestrated",
"type": "integer",
"title": "Altria Orchestrated",
"description": "Specifies whether the AT object is being called by Core Services (1) or from an outside source (0)",
"default": 0,
"enum": [
0, 1
],
"examples": [
0, 1
],
"minimum": 0,
"maximum": 1
},
"required": [
"altriaOrchestrated",
"initiativeName",
"date",
"inventory"
]
}"

我收到以下错误,但无法理解它是什么错误。由于这个问题,我的开发停止了。

 AGG ALL AND ARRAY BETWEEN BIGINT BIT BINARY BY COLUMNSET CREATED CSHARP CURRENT DATETIME DATETIME2 DECIMAL EXISTS FILE FLOAT FOLLOWING GROUP IN INT IS LENGTH LCID MAP MAX MODIFIED MONEY NULL NVARCHAR OR OVER PARTITION PRECEDING REAL SMALLINT SQL STRUCT TINYINT UNBOUNDED UNIQUEIDENTIFIER VARBINARY VARCHAR WITHIN string-literal numeric-literal character-literal punctuation-mark identifier quoted-identifier reserved-identifier variable system-variable '[' ']' '(' '{' '}' '=' '.' '*' ':' '?' '<' '>'

最佳答案

根据我的测试,您可以利用双引号、反斜杠,如下所示来声明您的 json 字符串参数。

DECLARE @json string ="{"+
"\"definitions\": {},"+
"\"$schema\": \"http://json-schema.org/draft-06/schema#\","+
"\"$id\": \"http://getIQOS.com/IQOSAbandonedCartV1.json\","+
"\"title\": \"CE:I:ORD:ABC\","+
"\"type\": \"object\","+
"\"properties\": {"+
"\"altriaOrchestrated\": {}"+
"}"+
"}";

此外,您还可以利用 Verbatim C# 字符串文字,通过在字符串的起始双引号前面添加 @ 字符来简化此类字符的处理。对于您的 json 字符串,您可以按如下方式声明它:

DECLARE @json string =@"{
""definitions"": {},
""$schema"": ""http://json-schema.org/draft-06/schema#"",
""$id"": ""http://getIQOS.com/IQOSAbandonedCartV1.json"",
""title"": ""CE:I:ORD:ABC"",
""type"": ""object"",
""properties"": {
""altriaOrchestrated"": {}
}
}";

注意:

The maximal size of a column of type string is 128kB in U-SQL (based on the byte count of the string value represented in UTF-8 encoding).

您可以关注的详细信息Textual Types and Literals .

关于azure - 将 JSON 架构插入 U-SQL 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50378105/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com