{"record":{"id":"92aaaa6018361543","repo":"apache/beam","slug":"invalid-boolean-value-s","errorCode":null,"errorMessage":"Invalid boolean value '%s'.","messagePattern":"Invalid boolean value '(.+?)'\\.","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeSchemaTransformUtils.java","lineNumber":244,"sourceCode":"        case FLOAT:\n          return Float.valueOf(value);\n\n        case DOUBLE:\n          return Double.valueOf(value);\n\n        case STRING:\n          return value;\n\n        case BOOLEAN:\n          if (\"true\".equalsIgnoreCase(value)) {\n            return true;\n          }\n\n          if (\"false\".equalsIgnoreCase(value)) {\n            return false;\n          }\n\n          throw new IllegalArgumentException(String.format(\"Invalid boolean value '%s'.\", value));\n\n        case BYTES:\n          return decodeHex(value);\n\n        case DATETIME:\n          return Instant.parse(value);\n\n        case DECIMAL:\n        case ARRAY:\n        case ITERABLE:\n        case MAP:\n        case ROW:\n        case LOGICAL_TYPE:\n        default:\n          throw unsupportedFieldType(field, null);\n      }\n    } catch (IllegalArgumentException e) {\n      throw new IllegalArgumentException(","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeSchemaTransformUtils.java#L226-L262","documentation":"When converting a Snowflake STRING cell to a Beam BOOLEAN field, toBeamValue only accepts \"true\" or \"false\" (case-insensitive). Any other string — including \"1\"/\"0\", \"yes\"/\"no\", \"t\"/\"f\", or whitespace-padded values — throws an IllegalArgumentException with the offending value.","triggerScenarios":"A Snowflake BOOLEAN column exported as \"1\"/\"0\" or \"TRUE \"/\"FALSE\" with whitespace, or a VARCHAR column holding yes/no strings, read into a Beam FieldType.BOOLEAN via toRow.","commonSituations":"Snowflake-to-CSV exports rendering booleans as 1/0; untrimmed values from fixed-width exports; user-authored VARCHAR columns with human-readable truthiness strings.","solutions":["Fix the source data to emit exactly \"true\"/\"false\" (e.g. CAST(col AS VARCHAR) or IFF(col, 'true','false') in the query).","Pre-normalize values in the pipeline before toRow (trim, map 1/0 to true/false).","Change the Beam field type to STRING and convert manually with your own tolerant parser."],"exampleFix":"// before\nString value = \"1\"; // read from Snowflake export\n// after\nString value = \"1\".equals(raw) ? \"true\" : (\"0\".equals(raw) ? \"false\" : raw.trim());","handlingStrategy":"validation","validationCode":"if (value == null || !(\"true\".equalsIgnoreCase(value.trim()) || \"false\".equalsIgnoreCase(value.trim()))) {\n  throw new IllegalArgumentException(\"not a boolean: \" + value);\n}","typeGuard":null,"tryCatchPattern":"try { Row r = SnowflakeSchemaTransformUtils.toRow(parts, schema); }\ncatch (IllegalArgumentException e) { normalizeOrDeadLetter(parts, e); }","preventionTips":["CAST boolean columns to 'true'/'false' strings in the query (IFF(col,'true','false')).","Trim whitespace from exported values.","Keep boolean columns as BOOLEAN in Snowflake rather than VARCHAR."],"tags":["java","snowflake","boolean","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}