I need help in following-
Old CSV file has 3 columns- id, fname, lname
New CSV file has 4 columns- id, fname, lname, dob
I have u updated the external schema as below-
CREATE EXTERNAL TABLE [dbo].[employee]
(
[id] [int] NOT NULL,
[fname] [nvarchar](50) NULL,
[lname] [nvarchar](50) NULL,
[dob] [datetime2](7) NULL
)
WITH (DATA_SOURCE = [EmpWarehouseStorage],LOCATION = N'Employee/New',FILE_FORMAT = [PipeFileFormat],REJECT_TYPE = VALUE,REJECT_VALUE = 10)
External Data source Query-
CREATE EXTERNAL DATA SOURCE [EmpWarehouseStorage]
WITH (TYPE = HADOOP, LOCATION = N'abfss://emp@****.dfs.core.windows.net',
CREDENTIAL = [EmpWarehouseStorageKey])
External File Format -
CREATE EXTERNAL FILE FORMAT [PipeFileFormat] WITH (FORMAT_TYPE = DELIMITEDTEXT, FORMAT_OPTIONS (FIELD_TERMINATOR = N'|', USE_TYPE_DEFAULT = False))
Querying external table throws the error -
1*** rows rejected from external table [Employee] in plan step 2 of query execution: Location: 'Employee/New/Employee_2***.csv' Column ordinal: 79, Expected data type: datetime2.
Just for debugging purposes, I have increased the REJECT_VALUE = 10000. I get to know that external shows only the new files data and does not show old files data.