{"record":{"id":"f6b192748964bc50","repo":"apache/seatunnel","slug":"table-schema-is-null-or-empty-describetable-retur","errorCode":null,"errorMessage":"Table schema is null or empty. DescribeTable returned: ","messagePattern":"Table schema is null or empty\\. DescribeTable returned: ","errorType":"exception","errorClass":"TableNotExistException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/catalog/LanceCatalog.java","lineNumber":200,"sourceCode":"                                    convertArrowSchemaToJsonArrowSchema(arrowSchemaFromDataset);\n                            log.debug(\n                                    \"Successfully got schema from dataset with {} fields\",\n                                    arrowSchema.getFields().size());\n                        }\n                    }\n                    dataset.close();\n                } catch (Exception e) {\n                    log.debug(\n                            \"Failed to get schema from dataset at {}: {}\",\n                            datasetPath,\n                            e.getMessage());\n                }\n            }\n\n            CatalogTable catalogTable =\n                    convertTableSchema(arrowSchema, tablePath, arrowSchemaFromDataset);\n            if (catalogTable == null) {\n                throw new TableNotExistException(\n                        catalogName,\n                        tablePath,\n                        new CatalogException(\n                                \"Table schema is null or empty. DescribeTable returned: \"\n                                        + (arrowSchema != null ? arrowSchema : \"null schema\")));\n            }\n            return catalogTable;\n        } catch (Exception e) {\n            String errorMsg = e.getMessage();\n            if (errorMsg != null\n                    && (errorMsg.contains(\"Table does not exist\")\n                            || errorMsg.contains(\"TABLE_NOT_FOUND\")\n                            || errorMsg.contains(\"404\"))) {\n                throw new TableNotExistException(catalogName, tablePath, e);\n            } else {\n                throw new CatalogException(\"Failed to get table: \" + tablePath.getTableName(), e);\n            }\n        }","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/catalog/LanceCatalog.java#L182-L218","documentation":"LanceCatalog.getTable reads the table's Arrow schema and calls convertTableSchema; if conversion returns null (schema is null or empty), it throws a TableNotExistException wrapping a CatalogException describing what DescribeTable returned. This signals the Lance dataset exists but yields no usable schema.","triggerScenarios":"getTable is called for a tablePath whose underlying Lance dataset returns an empty/null Arrow schema, so convertTableSchema produces no CatalogTable.","commonSituations":"Empty or corrupt Lance dataset directory; dataset written without columns; storage metadata missing/truncated; wrong dataset path pointing at an empty location that still resolves as a table.","solutions":["Verify the dataset at the table path is a valid, non-empty Lance dataset (inspect with lance tooling or read the manifest)","Recreate/rewrite the table with a proper schema","Check the catalog warehouse path configuration to ensure it points at the intended dataset","Confirm the storage backend is accessible and the dataset files were not truncated by a failed write"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"ArrowSchema schema = readArrowSchema(tablePath);\nif (schema == null || schema.getFields().isEmpty()) {\n    // treat as missing/invalid table before calling catalog.getTable\n}","typeGuard":null,"tryCatchPattern":"try {\n    catalogTable = lanceCatalog.getTable(tablePath);\n} catch (TableNotExistException e) {\n    // table absent or schema empty: create or repair dataset\n}","preventionTips":["Verify datasets are fully written before querying via the catalog","Monitor for failed/interrupted writes that leave empty datasets","Validate dataset manifests after storage migration","Point the warehouse config at the correct dataset root"],"tags":["lance","catalog","empty-schema"],"backgroundTag":"empty-result-set","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"}