I know how to do this with the DEFAULT
constraint when creating a table or with the UPDATE
and SET
when modifying a table with other SQL instances. Is there a simple way to do this with the .create table
or the .alter-merge table
Kusto command?
Here is my use case where this question comes from, if helpful:
I have a python script that drops (if exists), creates a table on Kusto, then ingests data from a local csv file into this table and it works well.
The csv file to be ingested has 3 columns. I would like to create a 4th column and insert with all the same value when it's being created/ingested into Kusto. Is this possible?
For example:
MyData.csv to be ingested (Header will be removed before ingestion) looks like this:
Date ID Name
1/1 1001 ABC_1
1/1 1002 3X4Y5Z
1/2 1003 DEF_a
Table to be created on Kusto will look like this:
Date ID Name The_Fixed_Value
1/1 1001 ABC_1 a
1/1 1002 3X4Y5Z a
1/2 1003 DEF_a a
I would like to fill The_Fixed_Value column with the same value 'a' when the python code runs.
Python reference: https://github.com/Azure/azure-kusto-python/blob/master/azure-kusto-ingest/tests/sample.py
Thanks so much in advance!