Radeity commented on code in PR #14423:
URL: 
https://github.com/apache/dolphinscheduler/pull/14423#discussion_r1247773938


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java:
##########
@@ -108,29 +121,40 @@ protected String buildCommand() {
 
         final String type = hiveCliParameters.getHiveCliTaskExecutionType();
 
+        String sqlContent = "";
+        String resourceFileName = "";
         // TODO: make sure type is not unknown
         if (HiveCliConstants.TYPE_FILE.equals(type)) {
-            args.add(HiveCliConstants.HIVE_CLI_EXECUTE_FILE);
             final List<ResourceInfo> resourceInfos = 
hiveCliParameters.getResourceList();
             if (resourceInfos.size() > 1) {
                 log.warn("more than 1 files detected, use the first one by 
default");
             }
 
-            
args.add(StringUtils.stripStart(resourceInfos.get(0).getResourceName(), "/"));
+            try {
+                resourceFileName = resourceInfos.get(0).getResourceName();
+                sqlContent = FileUtils.readFileToString(
+                        new File(String.format("%s/%s", 
taskExecutionContext.getExecutePath(), resourceFileName)),
+                        StandardCharsets.UTF_8);
+            } catch (IOException e) {
+                log.error("read hive sql content from file {} error ", 
resourceFileName, e);

Review Comment:
   Maybe we should throw exception here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to