简体   繁体   English

S3到Redshift:未知的布尔格式

[英]S3 to Redshift: Unknown boolean format

Executing a copy command from S3 to Redshift, loading JSON files. 执行从S3到Redshift的复制命令,加载JSON文件。 I have some fields as bool in a new table I'm inserting into and always getting the following error: "Unknown boolean format" 我在插入的新表中有一些字段作为bool并且始终收到以下错误:“未知的布尔格式”

My JSON is well parsed, ran a million tests on that already. 我的JSON解析得很好,已经对它进行了一百万次测试。 I've tried passing in the boolean fields as: 我试过传递布尔字段为:

false  //  "false"  //  "False"  //  0  //  "0"  //  null

But always get the same error, when executing: 但执行时总是得到相同的错误:

select * from stl_load_errors;

err_code  err_reason
1210      Unknown boolean format

I've seen some comments about using IGNOREHEADER in my statement but that isn't an option because the files I'm dealing with are in a single row json format. 我已经看到一些关于在我的语句中使用IGNOREHEADER的评论,但这不是一个选项,因为我正在处理的文件是单行json格式。 Ignoring the head would basically mean not reading thefile at all. 忽略头部基本上意味着根本不读取文件。 I have other tables working like this and work fine, but don't have any bool columns in those tables. 我有其他表像这样工作,工作正常,但在这些表中没有任何bool列。

The COPY from JSON Format documentation page provides an example that includes a Boolean: JSON格式文档页面中的COPY提供了一个包含布尔值的示例:

{
    "id": 0,
    "guid": "84512477-fa49-456b-b407-581d0d851c3c",
    "isActive": true,
    "tags": [
        "nisi",
        "culpa",
        "ad",
        "amet",
        "voluptate",
        "reprehenderit",
        "veniam"
    ],
    "friends": [
        {
            "id": 0,
            "name": "Carmella Gonzales"
        },
        {
            "id": 1,
            "name": "Renaldo"
        }
    ]
}

The Boolean documentation page shows values similar to what you have tried. 布尔文档页面显示的值类似于您尝试过的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM