{"record":{"id":"a8c61dc1f79a273e","repo":"apache/dolphinscheduler","slug":"read-hive-sql-content-error","errorCode":null,"errorMessage":"read hive sql content error","messagePattern":"read hive sql content error","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java","lineNumber":143,"sourceCode":"\n        String sqlContent = \"\";\n        String resourceFileName = \"\";\n        // TODO: make sure type is not unknown\n        if (HiveCliConstants.TYPE_FILE.equals(type)) {\n            final List<ResourceInfo> resourceInfos = hiveCliParameters.getResourceList();\n            if (resourceInfos.size() > 1) {\n                log.warn(\"more than 1 files detected, use the first one by default\");\n            }\n\n            try {\n                resourceFileName = resourceInfos.get(0).getResourceName();\n                ResourceContext resourceContext = taskRequest.getResourceContext();\n                sqlContent = FileUtils.readFileToString(\n                        new File(resourceContext.getResourceItem(resourceFileName).getResourceAbsolutePathInLocal()),\n                        StandardCharsets.UTF_8);\n            } catch (IOException e) {\n                log.error(\"read hive sql content from file {} error \", resourceFileName, e);\n                throw new TaskException(\"read hive sql content error\", e);\n            }\n        } else {\n            sqlContent = hiveCliParameters.getHiveSqlScript();\n        }\n\n        final Map<String, Property> paramsMap = taskRequest.getPrepareParamsMap();\n        sqlContent = ParameterUtils.convertParameterPlaceholders(sqlContent, ParameterUtils.convert(paramsMap));\n        log.info(\"HiveCli sql content: {}\", sqlContent);\n        String sqlFilePath = generateSqlScriptFile(sqlContent);\n\n        args.add(HiveCliConstants.HIVE_CLI_EXECUTE_FILE);\n        args.add(new File(sqlFilePath).getName());\n        final String hiveCliOptions = hiveCliParameters.getHiveCliOptions();\n        if (StringUtils.isNotEmpty(hiveCliOptions)) {\n            args.add(hiveCliOptions);\n        }\n\n        String command = String.join(\" \", args);","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java#L125-L161","documentation":"In buildCommand (TYPE_FILE mode), reading the hive SQL resource from storage threw — the referenced resource file could not be fetched via the storage operator (missing file, storage permission/path issue) or opening its stream failed. The offending input is the first resource in the task's resource list; the message is the sentinel 'read hive sql content error' with the storage exception as cause.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}