Four Stars

How to Validate file schema with metadata schema

Hi,

I need to validate the Excel file schema with metadata schema 

Please help me out to find the component which can do this ?

7 REPLIES
Four Stars

Re: How to Validate file schema with metadata schema

This can be done by using tSchemaComplianceCheck component available. This component validates the input schema with the schema defined on this component. Hence, the schema you have under metadata can be set on this component where your excel file can be main input of this component if I rightly understand what you are trying to do.

Four Stars

Re: How to Validate file schema with metadata schema

Thanks Pravin,

But i need to compare column list.

tSchemaComplianceCheck  do we have any option ?

 

Ten Stars

Re: How to Validate file schema with metadata schema

You want to compare the headers to an expected list of headers?
Six Stars

Re: How to Validate file schema with metadata schema

I guess we can only compare, type/Nullable/length/Data Pattern through tSchemaComplianceCheck.

 

I hv achieved this by joining 1st complete row in input csv file and lookup with tFixedFlowInput

 

ex : BUSINESS_DAY|RECORD_COUNT|SALES_SUMSSSS9999 (input file 1st row)

with

BUSINESS_DAY|RECORD_COUNT|SALES_SUM (tfixedflowinput)SchemaCheck.JPG

Four Stars

Re: How to Validate file schema with metadata schema

Yes we can compare only type,length,Data Pattern through tSchemaComplianceCheck,

is there any way to compare columns

Example:

In my metadata

metadata.JPG

 

In my file below are the columns

Excel.JPG

 

I need validate file schema with above metadata list.

Please suggest me. is there any way to do this?

Moderator

Re: How to Validate file schema with metadata schema

Hello,

Could you please try to build a string from your reference data (concatenating all columns delimited by a delimiter in your file) and configure a tFileInputDelimited with the delimiter to a value what never occurs in the file to prevent field separation, set also the limit to 1?
As schema is set only on column, you will get the header as one line and now you can compare it with your reference header line.

 

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: How to Validate file schema with metadata schema

Just take a look here: http://talendhowto.com/2017/09/06/check-csv-header-in-talend-open-studio/
I used this one, but replaced the tfixedinput by an input xml.