[
https://issues.apache.org/jira/browse/LENS-775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14802969#comment-14802969
]
Hudson commented on LENS-775:
-----------------------------
SUCCESS: Integrated in Lens-Commit #1084 (See
[https://builds.apache.org/job/Lens-Commit/1084/])
LENS-775 : NPE on closing HadoopFileFormatter (rajatgupta59: rev
f4c6c11e9637107a63493b98e3bb7d50966e52c1)
*
lens-query-lib/src/main/java/org/apache/lens/lib/query/HadoopFileFormatter.java
> NPE on closing HadoopFileFormatter
> ----------------------------------
>
> Key: LENS-775
> URL: https://issues.apache.org/jira/browse/LENS-775
> Project: Apache Lens
> Issue Type: Bug
> Reporter: Deepak Barr
> Assignee: Deepak Barr
> Priority: Minor
> Fix For: 2.4
>
> Attachments: LENS-775.patch
>
>
> In HadoopFileFormatter, If rowWriter intialization fails because of,say, HDFS
> permission issue. The close() method (called in finally block in
> ResultFormatter class) throws an NPE.
> Code snippet -
> public void setupOutputs() throws IOException {
> String pathStr = ctx.getResultSetParentDir();
> if (StringUtils.isBlank(pathStr)) {
> throw new IllegalArgumentException("No output path specified");
> }
> String outputPathStr = Strings.isNullOrEmpty(ctx.getQueryName()) ? ""
> : LensFileOutputFormat.getValidOutputFileName(ctx.getQueryName()) + "-";
> outputPath = new Path(pathStr, outputPathStr +
> ctx.getQueryHandle().toString());
> Path tmpWorkPath = new Path(pathStr, ctx.getQueryHandle().toString() +
> ".tmp");
> try {
> rowWriter = LensFileOutputFormat.createRecordWriter(ctx.getConf(),
> tmpWorkPath, Reporter.NULL,
> ctx.getCompressOutput(), ctx.getOuptutFileExtn(),
> ctx.getResultEncoding());
> numRows=0;
> } catch (IOException e) {
> throw new IllegalArgumentException("Could not create tmp path");
> }
> }
> @Override
> public void close() throws IOException {
> rowWriter.close(Reporter.NULL);
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)