{"record":{"id":"e8d0d54c3148087c","repo":"apache/beam","slug":"illegal-table-properties-json","errorCode":null,"errorMessage":"illegal table properties: ${json}","messagePattern":"illegal table properties: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/TableUtils.java","lineNumber":62,"sourceCode":"\n  private TableUtils() {\n    // nothing here\n  }\n\n  @VisibleForTesting\n  public static ObjectMapper getObjectMapper() {\n    return objectMapper;\n  }\n\n  public static ObjectNode emptyProperties() {\n    return objectMapper.createObjectNode();\n  }\n\n  public static ObjectNode parseProperties(String json) {\n    try {\n      return (ObjectNode) objectMapper.readTree(json);\n    } catch (JsonProcessingException e) {\n      throw new RuntimeException(\"illegal table properties: \" + json);\n    }\n  }\n\n  public static ObjectNode parseProperties(Map<String, String> map) {\n    return objectMapper.valueToTree(map);\n  }\n\n  public static Map<String, Object> convertNode2Map(JsonNode jsonNode) {\n    return objectMapper.convertValue(jsonNode, new TypeReference<Map<String, Object>>() {});\n  }\n}\n","sourceCodeStart":44,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/TableUtils.java#L44-L74","documentation":"TableUtils.parseProperties parses a JSON string into a Jackson ObjectNode representing table properties. If the string is not valid JSON (or not an object tree Jackson can read), the JsonProcessingException is rethrown as a RuntimeException with the offending input embedded.","triggerScenarios":"Calling parseProperties(String) with malformed JSON — trailing commas, single quotes, unquoted keys, or non-JSON text — typically from a table DDL TBLPROPERTIES clause.","commonSituations":"Hand-written TBLPROPERTIES using map-like syntax {'a':'b'} instead of JSON, copy/paste artifacts, encoding issues.","solutions":["Validate the JSON string with a linter before passing it (e.g. JSON must use double quotes: {\"a\":\"b\"})","Use parseProperties(Map<String,String>) overload to build properties from a map and skip JSON parsing entirely","Catch the RuntimeException and surface the offending string to the user for correction"],"exampleFix":"// before\nTableUtils.parseProperties(\"{'a':1}\");\n// after\nTableUtils.parseProperties(\"{\\\"a\\\":1}\");","handlingStrategy":"try-catch","validationCode":"objectMapper.readTree(json); // pre-validate in a probe call","typeGuard":null,"tryCatchPattern":"try { TableUtils.parseProperties(json); } catch (RuntimeException e) { throw new IllegalArgumentException(\"Fix TBLPROPERTIES JSON: \" + json, e); }","preventionTips":["Use the Map<String,String> overload instead of raw JSON","Lint JSON before submission","Always double-quote JSON keys and strings"],"tags":["json","sql","parsing"],"backgroundTag":"json-parse-error","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}