Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on
07-08-2014
10:43 AM
- last edited on
04-21-2026
07:01 AM
by
GrazittiAPI
com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier
Hi Folks,
I'm attempting to use sqoop2 from Hue to import a single column from one database table in MS SQL Server. That column is defined as 'nvarchar(max)', and contains a json document - which starts and ends with curly braces {...}.
The sqoop2 job fails with: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier
I suspect it's trying to convert the string value to a UID simply because it starts and ends with curly braces, buy hey, I'm just guessing.
I see in the sqoop (version 1) docs that you can override the default conversions using:
Table�3.�Parameters for overriding mapping
Argument Description
| --map-column-java <mapping> | Override mapping from SQL to Java type for configured columns. |
| --map-column-hive <mapping> | Override mapping from SQL to Hive type for configured columns. |
How can I use these overrides in sqoop2 via Hue? Or another way? Or am I off on the wrong path here?
Thanks,
ws
Created 07-09-2014 10:21 AM
Created 07-08-2014 12:46 PM
Created 07-09-2014 06:25 AM
Sure, here's the MS SQL create script:
CREATE TABLE [dbo].[Assets](
[AssetId] [uniqueidentifier] NOT NULL,
[Value] [nvarchar](max) NULL,
[LastModifiedDate] [datetime] NOT NULL,
[LastSyncronizedDate] [datetime] NULL,
[SyncId] [nvarchar](128) NULL,
CONSTRAINT [PK_dbo.Assets] PRIMARY KEY CLUSTERED
(
[AssetId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
Created 07-09-2014 10:21 AM
Created 07-09-2014 11:28 AM
Created 07-09-2014 11:37 AM
Created 07-09-2014 11:43 AM
Created 07-09-2014 11:52 AM
Created 07-09-2014 12:42 PM
Yup you're right - sorry, I was looking at the table creation pages, not the sqoop import pages.
The SQOOP-777 issue seems to reference column and record limiters. Is my single-quote problem one of these? I would think not, since a single quote is being inserted at the beginning AND the end of the column value. It's behaving like it's enclosing the column value in single quotes, rather than a field or record delimiter.
Created 07-09-2014 12:46 PM