{"record":{"id":"e5ce61b5d57a6741","repo":"apache/seatunnel","slug":"table-format-cannot-be-null-or-empty","errorCode":null,"errorMessage":"Table format cannot be null or empty","messagePattern":"Table format cannot be null or empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveFormatUtils.java","lineNumber":103,"sourceCode":"                return \"'orc.compress'='ZLIB',\\n  'created_by'='seatunnel'\";\n            case \"TEXTFILE\":\n                return \"'created_by'='seatunnel'\";\n            default:\n                return \"'created_by'='seatunnel'\";\n        }\n    }\n\n    /** Check if compression should be enabled for the format */\n    public static boolean shouldEnableCompression(String format) {\n        format = format.toUpperCase();\n        // Enable compression for PARQUET and ORC, not for TEXTFILE by default\n        return \"PARQUET\".equals(format) || \"ORC\".equals(format);\n    }\n\n    /** Validate if the format is supported */\n    public static void validateFormat(String format) {\n        if (format == null || format.trim().isEmpty()) {\n            throw new IllegalArgumentException(\"Table format cannot be null or empty\");\n        }\n\n        format = format.toUpperCase();\n        if (!\"PARQUET\".equals(format) && !\"ORC\".equals(format) && !\"TEXTFILE\".equals(format)) {\n            throw new IllegalArgumentException(\n                    \"Unsupported table format: \"\n                            + format\n                            + \". Supported formats: PARQUET, ORC, TEXTFILE\");\n        }\n    }\n}\n","sourceCodeStart":85,"sourceCodeEnd":115,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveFormatUtils.java#L85-L115","documentation":"HiveFormatUtils.validateFormat rejects null or blank (empty/whitespace-only) format strings before checking supported values. The table format is a required discriminator for configuring the storage descriptor, so an absent value cannot proceed.","triggerScenarios":"Calling validateFormat(null) or validateFormat(\"\") / validateFormat(\"   \") — typically when the format could not be derived from the table's input format class or a config option was not set.","commonSituations":"Config option (e.g. table_format) omitted by the user, or a Hive table whose input format class failed to map to a canonical format name upstream.","solutions":["Set the format explicitly in the connector config (e.g. table_format = PARQUET).","Ensure the Hive table declares a standard STORED AS PARQUET/ORC/TEXTFILE so the format can be derived.","Guard upstream derivation code to default to a supported format instead of passing null.","Add a pre-check on user config before submitting the job."],"exampleFix":"// before\nhive.source.table-format = \"\"\n// after\nhive.source.table-format = \"PARQUET\"","handlingStrategy":"validation","validationCode":"HiveFormatUtils.validateFormat(configuredFormat); // call before submitting the job\n// or inline:\nif (configuredFormat == null || configuredFormat.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"table_format option is required\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    HiveFormatUtils.validateFormat(format);\n} catch (IllegalArgumentException e) {\n    LOG.error(\"Set table_format (PARQUET/ORC/TEXTFILE) in config\", e);\n    throw e;\n}","preventionTips":["Always set the table_format option explicitly in connector config","Ensure source Hive tables declare a standard STORED AS clause","Run validateFormat in a pre-submit config check"],"tags":["hive","format","validation","null"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}