You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by ravikiran23 <gi...@git.apache.org> on 2016/09/16 18:43:08 UTC

[GitHub] incubator-carbondata pull request #160: [CARBONDATA-245] Actual Exception is...

GitHub user ravikiran23 opened a pull request:

    https://github.com/apache/incubator-carbondata/pull/160

    [CARBONDATA-245] Actual Exception is getting lost in case of data dictionary file generation.

    PROBLEM : 
    during data load if any exception comes when the dictionary file is getting generated.
    then in the finally block trying to write the meta file but as the stream is null, it will throw null pointer.
      
    solution : 
    in the finally added a check whether the stream is null or not. then only writing data to the stream.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ravikiran23/incubator-carbondata nullPointerInDataLoad

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-carbondata/pull/160.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #160
    
----
commit 58335f16ac3541b2ebcf157e933ab5291a59e9c1
Author: ravikiran <ra...@gmail.com>
Date:   2016-09-16T18:34:38Z

    if for any reason data load is failed during the dictionary generation then in the finally block trying to write the meta file but as the stream is null, it will throw null pointer.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #160: [CARBONDATA-245] Actual Exception is...

Posted by vinodkc <gi...@git.apache.org>.
Github user vinodkc commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/160#discussion_r79282603
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/writer/ThriftWriter.java ---
    @@ -80,6 +80,17 @@ public void open() throws IOException {
       }
     
       /**
    +   * This will check whether stream and binary out is open or not.
    +   * @return
    +   */
    +  public boolean isOpen() {
    +    if (null != binaryOut && null != dataOutputStream) {
    --- End diff --
    
    need to set  binaryOut  and dataOutputStream to null in close() method


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #160: [CARBONDATA-245] Actual Exception is...

Posted by vinodkc <gi...@git.apache.org>.
Github user vinodkc commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/160#discussion_r79282613
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImpl.java ---
    @@ -199,7 +199,10 @@ public CarbonDictionaryWriterImpl(String hdfsStorePath,
        */
       @Override public void close() throws IOException {
         if (null != dictionaryThriftWriter) {
    -      writeDictionaryFile();
    +      // if stream is open then only need to write dictionary file.
    +      if(dictionaryThriftWriter.isOpen()){
    --- End diff --
    
    Combine both if conditions 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #160: [CARBONDATA-245] Actual Exception is...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-carbondata/pull/160


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #160: [CARBONDATA-245] Actual Exception is...

Posted by ravikiran23 <gi...@git.apache.org>.
Github user ravikiran23 commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/160#discussion_r79284253
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImpl.java ---
    @@ -199,7 +199,10 @@ public CarbonDictionaryWriterImpl(String hdfsStorePath,
        */
       @Override public void close() throws IOException {
         if (null != dictionaryThriftWriter) {
    -      writeDictionaryFile();
    +      // if stream is open then only need to write dictionary file.
    +      if(dictionaryThriftWriter.isOpen()){
    --- End diff --
    
    fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #160: [CARBONDATA-245] Actual Exception is...

Posted by ravikiran23 <gi...@git.apache.org>.
Github user ravikiran23 commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/160#discussion_r79284972
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/writer/ThriftWriter.java ---
    @@ -80,6 +80,17 @@ public void open() throws IOException {
       }
     
       /**
    +   * This will check whether stream and binary out is open or not.
    +   * @return
    +   */
    +  public boolean isOpen() {
    +    if (null != binaryOut && null != dataOutputStream) {
    --- End diff --
    
    in close  we are using util to close the stream so i think no need to set null explicitly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---