Validate date column in CSV with Data Factory - csv

I'm attempting to use Data Factory to import a CSV file from Azure File storage into SQL Azure. So far I'm using the copy data task to read the CSV and save into SQL Azure.
My CSV file contains 2 date columns with the date in the format dd/MM/yyyy. How can I set Data Factory to validate and read dates in this format?

You can follow my step, I tried this and Data Factory can validate and read dates in "dd/MM/yyyy" format.
This is my csv file, also has two columns with the date in the format "dd/MM/yyyy".
The difference between us is I import my file from Azure blob storage into my Azure SQL database by using Copy Data.
If you want Data Factory can validate and read dates in "dd/MM/yyyy" format, during File format settings, you must set the the schema, specify the column type and the format. Please see this picture:
After copy active completed, the date with "dd/MM/yyyy" format will be parsed to the default format "yyyy-MM-dd".
Hope this helps.

Related

Error for column count mismatch for JSON, AVRO, ORC and PARQUET file formats

We are using a copy command for loading data into Snowflake. With CSV file format, there is a parameter 'ERROR_ON_COLUMN_COUNT_MISMATCH' to get the error if columns present in input CSV file do not match with Snowflake's target database table. Is there any similar parameter for JSON, AVRO, ORC and PARQUET file formats to get the error if there is a column count mismatch?
The same parameter is used for other file-formats as well (i.e. JSON, Parquet etc.)
See here -
https://docs.snowflake.com/en/sql-reference/sql/create-file-format.html#syntax

MySQL to GeoMesa through .csv

I have a MySQL table whose data I have to export to .csv and then ingest this .csv to GeoMesa.
My Mysql table structure is like below:
[
Now, as you can see the the_geom attribute of table has data type point and in database it is stored as blob like shown below:
Now I have two problems :
When I export the MySQL data into a (.csv) file my csv file shows (...) for the_geom attribute as shown below instead of any binary representation or anything which will allow it to be ingested in GeoMesa. So, how to overcome this?
Csv file also shows # for any attribute with datetime datatype but if you expand the column the date time can be seen as sown in below picture (however my question is does it will cause problem in geomesa?).
For #1, MySQL's export is not automatically converting the Point datatype into text for you. You might need to call a conversion function such as AsWKT to output the geometry as Well Known Text. The WKT format can be used by GeoMesa to read in the Point data.
For #2, I think you'll need to do the same for the date field. Check out the date and time functions.

SSIS Data Type Conversion

I am having an excel file with huge records. I want to import it into OLEDB destination in SSIS. While using Data Type Conversion to change the data type, One of the column "Date" is showing as "Unicode string [DT_WSTR]". How to change it to datetime?
Can some one please help me on this.
You have to use
DT_DBTIMESTAMP
if you have datetime into your DB.
For your string format:
yyyy-MM-dd hh:mm:ss
If you can get your string dates into that format, you're guaranteed to get a correct conversion.

How do I format the "money" data type in a CSV file for a MySQL database?

For a project I'm creating sample data in .csv files but one of the datatypes is "Money" but I haven't used this data type before. How would I format the numbers in the .csv file for the sample data? Would it be something like "3000.00" similar to a float?

How to import excel stored data in MySQL and keep date format as yyyy-mm-dd hh:mm:ss

I have come across somewhat difficult task to complete. I have an excel document with various columns and two of them are date columns with values in this format yyyy-mm-dd hh:mm:ss.
I need to import all this data in MySQL and so far tried to do it with a CSV file using phpmyadmin.
The problem is that CSV is changing the date format from yyyy-mm-dd hh:mm:ss to dd/mm/yyyy hh:mm:ss.
What other ways exist to import data originating from excel file into MySQL and keep the data format?
I would appreciate some simple solution if such exists.
Thank you!
I'm not familiar with importing Excel files into MySQL, in SQL Server this is trivial using the import wizard so I'd assume something similar exists for MySQL.
If you need to, you can convert the value to text with the format of your choosing in Excel with the following:
=TEXT(A1,"yyyy-mm-dd hh:MM:ss")
This format will persist in the csv.
Answering my question here - one possibility to export dates from excel into CSV file and keep the date format as yyyy-mm-dd or yyyy-mm-dd hh:mm:ss is to save the file as .ods document - the file format of Open Office.
From the .ods file you can save your document as CSV file and the dates are being kept as yyyy-mm-dd or yyyy-mm-dd hh:mm:ss. For some reason Open Office keeps the selected date format when saving into CSV and Excel does not.
Hope this helps someone.