Friday, June 20, 2014

Sqoop : Import data from SAP HANA to HDFS : (Error: org.apache.sqoop.common.SqoopException: GENERIC_JDBC_CONNECTOR_0011:The type is not supported - -9) [SOLVED]


 On a hot summer Friday evening, there I was trying to import data from HANA to HDFS using SQOOP (version 1.4.3-cdh4.6.0). Here is how I tried doing it :

STEPS :



1. Goto HUE -> SQOOP



2. Click on 'New Job




3. Give Name to the Job and Select 'Import' as Job Type and click on 'Add a new connection'





4.  Create New Connection and Save 




5. Now back on New Job screen, select connection as the same connection created above and click Next






6. Give details for the source schema, table name and partition column name and click next





7. Choose Destination HDFS




8. Click 'Save and run'

9. At this step I encountered the following peculiar error message :

Error: org.apache.sqoop.common.SqoopException: GENERIC_JDBC_CONNECTOR_0011:The type is not supported - -9

10. After a lot of searching and head scratching I found the solution. The solution was simple :
            The 'Partition column name' in 'Database' section should be an INT in HANA!
            After correcting the column to a INT column, this worked like a charm.


This was my first time with Sqoop. There might be better ways to do it, let me know via comments.

Thanks!


Thursday, July 28, 2011

Subclassing NSTextView - detecting paste event

Learning Cocoa (some random thoughts) : Subclassing NSTextView :

Created a custom NSTexView, and wanted to provide a placeholder string which will disappear when the user starts typing.


Thought overriding 
-(void)mouseDown:(NSEvent*)event ,
and
-(void)keyDown:(NSEvent*)event 
will be sufficient.


But, when this custom textview is the first responder of events(i.e. in focus when the nib loads), pasting/drag-drop on this textview did not clear the placeholder string.


After some more search(thanks to mac dev library and Jeremy), found out that I had to override :
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSString *)type

This helped in detecting the paste events/operation on my custom textview component. And voilĂ  my custom NSTextView now works amazing.


- Ciao.