我想在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 '[' ']' '(' '{' '}' '=' '.' '*' ':' '?' '<' '>'
答案 0 :(得分:0)
根据我的测试,你可以利用双引号反斜杠来声明你的json字符串参数。
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:4.0.0'
}
此外,您可以利用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\": {}"+
"}"+
"}";
注意:
U-SQL中字符串类型的列的最大大小为128kB(基于以UTF-8编码表示的字符串值的字节数)。
您可以关注Textual Types and Literals的详细信息。