Reputation: 57
I am having difficulty creating external table in SMSS. I have the dataset stored in BLOB storage and try to load it from there in to external table. I keep getting this error:
HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: HadoopSqlException: Error converting data type NVARCHAR to INT
i used the following query
CREATE EXTERNAL TABLE [ext].[klant](
[number] [int] NOT NULL,
[customer_id] [int] NOT NULL,
[status] [nvarchar](50) NOT NULL,
[shipping.postcode] [nvarchar](50) NOT NULL,
[date_created] [datetime2](0) NOT NULL,
[date_completed] [datetime2](0) NOT NULL,
[shipping.address_1] [nvarchar](50) NOT NULL,
[shipping.city] [nvarchar](50) NOT NULL
)
WITH (
LOCATION='/customer/',
DATA_SOURCE = storage,
FILE_FORMAT = fileformat,
REJECT_TYPE = VALUE,
REJECT_VALUE = 0
);
I also tried to solve this problem in ADF by copying the data from source to table, but with no luck. I hope somebody could help me with this problem. thanks in advance
Upvotes: 1
Views: 2836
Reputation: 1027
Thank you for verifying the CREATE EXTERNAL DATA SOURCE statement. Your specific issue is with one of the column definitions between what is defined in your CREATE EXTERNAL TABLE statement and what is actually in your data file.
Error converting data type NVARCHAR to INT
The data in the source data file, either the number
column or customer_id
column is nvarchar and trying to be stored as int. Do you have any extra characters in your data file?
The error indicates a data type or column mismatch.
Upvotes: 1