sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Jarcec Cecho (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SQOOP-1811) IDF API changes
Date Fri, 05 Dec 2014 22:23:12 GMT

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

Jarek Jarcec Cecho commented on SQOOP-1811:
-------------------------------------------

{quote}Rename this to CSVIntermediateDataFormatError since it is relevant to CSV Implementaion.{quote}

Are we planning to have one {{*Error}} class per concrete IDF implementation or shared for
all of the build-in ones? I'm fine to rename it if we are planning to have separate Error
class for each IDF.

{quote}Any reason we have the IDF api in SDK and not in sqoop-common ?{quote}

IDF is connector specific, so it definitely do not belong to {{sqoop-common}}. I'm not sure
whether better home would be {{sqoop-spi}} or {{sqoop-core}}. Perhaps [~hshreedharan] who
has originally worked on it could help us out to see what was the reason to put even the abstract
class [{{IntermediateDataFormat}}|https://github.com/apache/sqoop/blob/sqoop2/connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/IntermediateDataFormat.java]
to {{sqoop-connector-sdk}}

> IDF API changes
> ---------------
>
>                 Key: SQOOP-1811
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1811
>             Project: Sqoop
>          Issue Type: Sub-task
>          Components: sqoop2-framework
>            Reporter: Veena Basavaraj
>             Fix For: 1.99.5
>
>
> 1. update the java docs for IDF apis.
> 2.  Make the getTextData final and call it getCSV and setCSV, so it is obvious that we
want to enforce CSV format
>  the following code can move to the base class IntermediateDataFormat and made final,
so there is no way to override this and we can enforce all to return String instead of generic
T
> {code}
> // hold the string in IDF base class
>  private final String text.
>  
>   public final String getCSVTextData() {
>     return text;
>   }
>  
>   public final void setCSVTextData(String text) {
>     this.text = text;
>   }
> {code}
> There is code in CSVIDF implementation that has the rules for CSV parsing that can be
pulled out into CSV Utils so that the connectors can use
> The T in CSV happens to String, which is just a coincidence, If I write a new IDF implementation
T can be a custom object that could encapsulate the whole row.
> Third, getData and setData can have custom implementation so they can be overriden to
return the generic type T
> Correction :
> {code}
> // hold the string in IDF base class, is !final
>  private String text.
>  
>   public final String getCSVTextData() {
>     return text;
>   }
>  
>   public final void setCSVTextData(String text) {
>     this.text = text;
>   }
> {code}



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

Mime
View raw message