[
https://issues.apache.org/jira/browse/SQOOP-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14275370#comment-14275370
]
Sqoop QA bot commented on SQOOP-2006:
-------------------------------------
Testing file
[SQOOP-2006.patch|https://issues.apache.org/jira/secure/attachment/12691949/SQOOP-2006.patch]
against branch sqoop2 took 0:35:24.829608.
{color:red}Overall:{color} -1 due to 10 errors
{color:red}ERROR:{color} Patch does not add/modifny any test case
{color:red}ERROR:{color} Some unit tests failed
([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/924/artifact/patch-process/test_unit.txt])
{color:red}ERROR:{color} Failed unit test:
{{org.apache.sqoop.connector.idf.TestCSVIntermediateDataFormat}}
{color:red}ERROR:{color} Failed unit test:
{{org.apache.sqoop.connector.idf.TestJSONIntermediateDataFormat}}
{color:red}ERROR:{color} Failed unit test:
{{org.apache.sqoop.connector.idf.TestAVROIntermediateDataFormat}}
{color:red}ERROR:{color} Some integration tests failed
([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/924/artifact/patch-process/test_integration.txt])
{color:red}ERROR:{color} Failed integration test:
{{org.apache.sqoop.connector.idf.TestCSVIntermediateDataFormat}}
{color:red}ERROR:{color} Failed integration test:
{{org.apache.sqoop.integration.connector.kafka.FromHDFSToKafkaTest}}
{color:red}ERROR:{color} Failed integration test:
{{org.apache.sqoop.connector.idf.TestJSONIntermediateDataFormat}}
{color:red}ERROR:{color} Failed integration test:
{{org.apache.sqoop.connector.idf.TestAVROIntermediateDataFormat}}
{color:green}SUCCESS:{color} Clean was successful
{color:green}SUCCESS:{color} Patch applied correctly
{color:green}SUCCESS:{color} License check passed
{color:green}SUCCESS:{color} Patch compiled
Console output is available
[here|https://builds.apache.org/job/PreCommit-SQOOP-Build/924/console].
This message is automatically generated.
> bad smell: NPE check in SQOOP-1995 is not obvious
> -------------------------------------------------
>
> Key: SQOOP-2006
> URL: https://issues.apache.org/jira/browse/SQOOP-2006
> Project: Sqoop
> Issue Type: Improvement
> Affects Versions: 1.99.5
> Reporter: Qian Xu
> Assignee: Qian Xu
> Priority: Minor
> Fix For: 1.99.5
>
> Attachments: SQOOP-2006.patch
>
>
> SQOOP-1995 fixed a NPE, which is adding a schema NPE check in 6 get/set
> FooData methods. [~vybs] explained that the IDF class can be instantiated by
> reflection, which will call the default no arg constructor, so that the
> property schema will not be assigned expectedly.
> IMO, although the patch can guard invalid access to a null schema, but as the
> getter and setter methods have nothing to do with schema and there is no
> comment left, it will be hard to understand why we have such code after
> couple of months.
> It seems a IDF class should have a not null schema the whole life time. I've
> some options:
> 1. We check null schema where a NPE happens
> 2. Disallow reflection of IDF class or search all code occurrences to make
> sure schema will be set properly (I think we already have test cases to guard
> use cases)
> 3. Use some design by contract framework
> (https://github.com/nhatminhle/cofoja) to define invariant, e.g.
> {{@Invariant(schema != null)}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)