{"record":{"id":"4e4748fbbee10474","repo":"apache/seatunnel","slug":"table-schema-get-failed-4e4748","errorCode":"TABLE_SCHEMA_GET_FAILED","errorMessage":"Create ParquetMetadata Fail!","messagePattern":"Create ParquetMetadata Fail!","errorType":"error_code","errorClass":"HudiConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/util/HudiUtil.java","lineNumber":104,"sourceCode":"            }\n            if (fileStatus.isFile()) {\n                if (fileStatus.getPath().toString().endsWith(\"parquet\")) {\n                    return fileStatus.getPath().toString();\n                }\n            }\n        }\n        return null;\n    }\n\n    public static SeaTunnelRowType getSeaTunnelRowTypeInfo(String confPaths, String path)\n            throws HudiConnectorException {\n        Configuration configuration = getConfiguration(confPaths);\n        Path dstDir = new Path(path);\n        ParquetMetadata footer;\n        try {\n            footer = ParquetFileReader.readFooter(configuration, dstDir, NO_FILTER);\n        } catch (IOException e) {\n            throw new HudiConnectorException(\n                    CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,\n                    \"Create ParquetMetadata Fail!\",\n                    e);\n        }\n        MessageType schema = footer.getFileMetaData().getSchema();\n        String[] fields = new String[schema.getFields().size()];\n        SeaTunnelDataType[] types = new SeaTunnelDataType[schema.getFields().size()];\n\n        for (int i = 0; i < schema.getFields().size(); i++) {\n            fields[i] = schema.getFields().get(i).getName();\n            types[i] = BasicType.STRING_TYPE;\n        }\n        return new SeaTunnelRowType(fields, types);\n    }\n\n    public static JobConf toJobConf(Configuration conf) {\n        if (conf instanceof JobConf) {\n            return (JobConf) conf;","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/util/HudiUtil.java#L86-L122","documentation":"HudiUtil.getSeaTunnelRowTypeInfo reads a Parquet footer from the table directory to infer the SeaTunnel row type; if ParquetFileReader.readFooter throws IOException it wraps it in HudiConnectorException (TABLE_SCHEMA_GET_FAILED) with 'Create ParquetMetadata Fail!'.","triggerScenarios":"readFooter fails on the given path: directory has no/broken Parquet files, path doesn't exist, wrong conf paths (missing HDFS config), or permission/IO errors.","commonSituations":"Empty table directory with no data files yet; misconfigured hdfs conf paths; reading a table written by an incompatible Parquet writer; network/permission issues on HDFS.","solutions":["Verify the table path contains valid Parquet data files before starting","Fix the HDFS conf paths configuration so the reader can access the cluster","Check read permissions on the table directory for the job user","Upgrade/align Parquet/Hudi versions if files are unreadable"],"exampleFix":"// before: conf paths missing -> readFooter fails with IOException\n// after\n\"hdfs_conf_paths\" = [\"/etc/hadoop/core-site.xml\", \"/etc/hadoop/hdfs-site.xml\"]","handlingStrategy":"try-catch","validationCode":"// before running, ensure table dir has parquet files and hdfs confs exist\nPath p = new Path(tablePath);\nFileSystem fs = p.getFileSystem(conf);\nif (!fs.exists(p) || !fs.listStatus(p, f -> f.getPath().getName().endsWith(\".parquet\")).hasNext()) {\n    throw new IllegalStateException(\"No Parquet files under \" + tablePath + \"; schema inference will fail\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    SeaTunnelRowType type = HudiUtil.getSeaTunnelRowTypeInfo(confPaths, tablePath);\n} catch (HudiConnectorException e) {\n    if (\"Create ParquetMetadata Fail!\".equals(e.getErrorMessage())) {\n        LOG.error(\"Footer read failed; check path/data files/hdfs conf; cause: {}\", e.getCause(), e.getCause());\n    } else { throw e; }\n}","preventionTips":["Only run schema inference on tables with existing Parquet data files","Provide correct hdfs conf paths (core-site.xml, hdfs-site.xml)","Verify read permissions for the job user on the table directory"],"tags":["hudi","parquet","schema","file-read"],"backgroundTag":"file-read-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}