Hi Bhavesh In default there is no primary key/unique identifier support in hive. If you require some of your column to have unique values you need to programatically handle it out side hive before data loading into destination table. I believe you are importing data from RDBMS to hive, if your PK is preserved in rdbms the same data comes to hive so no need to explicity handle the same, just do SQOOP import. But if that is not the case you may need to import the RDBMS table to a temp/staging table in hive and from there based on the business requirement load the distinct values into destination table using some hive QL.
The SQOOP error could be resolved only by specify some numeric column with the --split-by argument instead of addressuid. There is of the fact that addressuid datatype is not acceptable for SQL MIN and MAX functions. This error is thrown at the time sqoop calculates the boundary values to decide on task division between mappers. You can try overcoming this error by specifying --num-mappers as 1, but no parallelism and hence not so good for production purposes. Hope it helps!... Regards Bejoy.K.S ________________________________ From: Bhavesh Shah <bhavesh25s...@gmail.com> To: sqoop-u...@cloudera.org; user@hive.apache.org Sent: Wednesday, February 1, 2012 10:35 AM Subject: is Uniqueidentifier with primary key supported in Hive? Hello Sir, I am trying for importing the table from SQL into Hive. In SQL I have the table in which one of the field is primary key having datatype "UiqueIdentifier" While importing in Hive the sqoop applies uses this as : (console log) : INFO db.DataDrivenDBInputFormat: BoundingValsQuery: SELECT MIN([addressuid]), MAX([addressuid]) FROM [Address] Hence it give the error as : ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: com.microsoft.sqlserver.jdbc.SQLServerException: Operand data type uniqueidentifier is invalid for min operator. My question is that Does Hive support uniqueidentifier with primary key? How should I solve this problem? Pls suggest me some solution. -- Thanks and Regards, Bhavesh Shah