Skip to content

Commit

Permalink
Decode value of hive.query.string for the job Confguration which was …
Browse files Browse the repository at this point in the history
…encoded by hive
  • Loading branch information
granewang committed Feb 1, 2024
1 parent 4f4b846 commit cc58401
Showing 1 changed file with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import static org.apache.hadoop.yarn.webapp.view.JQueryUI._TH;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.v2.api.records.JobId;
Expand All @@ -48,6 +50,21 @@ public class ConfBlock extends HtmlBlock {
appContext = appctx;
}

/**
* To URLDecode the string value for URLEncoded data

Check failure on line 54 in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/ConfBlock.java

View check run for this annotation

ASF Cloudbees Jenkins ci-hadoop / Apache Yetus

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/ConfBlock.java#L54

blanks: end of line
*

Check failure on line 55 in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/ConfBlock.java

View check run for this annotation

ASF Cloudbees Jenkins ci-hadoop / Apache Yetus

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/ConfBlock.java#L55

blanks: end of line
* @param value string data to be decoded
* @return value data after decoded

Check failure on line 57 in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/ConfBlock.java

View check run for this annotation

ASF Cloudbees Jenkins ci-hadoop / Apache Yetus

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/ConfBlock.java#L57

blanks: end of line
* @throws UnsupportedEncodingException if empty string or unsupported enc parameter.
*/
private String urlDecode(String value){
try {
return URLDecoder.decode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
return value;
}
}

/*
* (non-Javadoc)
* @see org.apache.hadoop.yarn.webapp.view.HtmlBlock#render(org.apache.hadoop.yarn.webapp.view.HtmlBlock.Block)
Expand Down Expand Up @@ -95,12 +112,21 @@ public class ConfBlock extends HtmlBlock {
first = false;
buffer.append(sources[i]);
}
tbody.
tr().
if( entry.getName().equals("hive.query.string")){
tbody.
tr().
td(entry.getName()).
td(urlDecode(entry.getValue())).
td(buffer.toString()).
__();
}else{
tbody.
tr().
td(entry.getName()).
td(entry.getValue()).
td(buffer.toString()).
__();
}
}
tbody.__().
tfoot().
Expand Down

0 comments on commit cc58401

Please sign in to comment.