[ 
https://issues.apache.org/jira/browse/HAWQ-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15032967#comment-15032967
 ] 

ASF GitHub Bot commented on HAWQ-120:
-------------------------------------

Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/123#discussion_r46234265
  
    --- Diff: 
pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/utilities/UtilitiesTest.java
 ---
    @@ -45,4 +48,26 @@ public void byteArrayToOctalString() throws Exception {
             assertEquals(orig.length() + (octal.length() * 5), sb.length());
             assertEquals(expected, sb.toString());
         }
    +
    +    @Test
    +    public void createAnyInstanceOldPackageName() throws Exception {
    +
    +        InputData metaData = mock(InputData.class);
    +        String className = "com.pivotal.pxf.Lucy";
    +        ClassNotFoundException exception = new 
ClassNotFoundException(className);
    +        PowerMockito.mockStatic(Class.class);
    +        when(Class.forName(className)).thenThrow(exception);
    +
    +        try {
    +            Utilities.createAnyInstance(InputData.class,
    +                    className, metaData);
    +            fail("creating an instance should fail because the class 
doesn't exist in classpath");
    +        } catch (Exception e) {
    +            assertEquals(e.getClass(), Exception.class);
    +            assertEquals(
    +                    e.getMessage(),
    +                    "Class " + className + " doesn't not appear in 
classpath. "
    --- End diff --
    
    Good catch! thanks!


> Add grace error message after namespace change
> ----------------------------------------------
>
>                 Key: HAWQ-120
>                 URL: https://issues.apache.org/jira/browse/HAWQ-120
>             Project: Apache HAWQ
>          Issue Type: Improvement
>          Components: PXF
>            Reporter: Goden Yao
>            Assignee: Noa Horn
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> In HAWQ-45, we've updated pxf name space to org.apache.hawq.
> Given the legacy version of PXF might have existed with the old namespace 
> table definition, it'd be good to have error messages like "com.pivotal.pxf 
> was an old namespace used in the previous versions, please switch to 
> org.apache.pxf as the new namespace and update your table definitions." 
> during *SELECT..." or "INSERT..." table queries.
> This is an addition to current error detection logic only when we figured 
> users are using the old namespace.
> The error message should apply to both READ and WRITE pxf tables.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to