microsoft / Kusto-Query-Language

Kusto Query Language is a simple and productive language for querying Big Data.
Apache License 2.0
510 stars 97 forks source link

.alter table policy partitioning recognized as AlterTablePolicyUpdate #102

Closed vplauzon closed 1 year ago

vplauzon commented 1 year ago

The follow script is parsed as CustomCommand with CommandKind=="AlterTablePolicyUpdate":

.alter table mydb.mytable policy partitioning ```
{
'PartitionKeys': [
{
'ColumnName': 'my_string_column',
'Kind': 'Hash',
'Properties': {
'Function': 'XxHash64',
'MaxPartitionCount': 128,
'PartitionAssignmentMode': 'Uniform'
}
}
]
}```
mattwar commented 1 year ago

It's getting hung up on the qualified table name. It is specified incorrectly in the parser to only allow just the table name. Most commands that allow you to specify table names only expect tables from the current database. A few allow qualified names.

vplauzon commented 1 year ago

That is legal KQL, i.e. it is accepted by Kusto query API. Can we fix this?

vplauzon commented 1 year ago

It also used to be supported in the past version of Kusto.Language.

mattwar commented 1 year ago

I've modified the definition for Kusto.Language to include the correct kind of table reference for this command.

vplauzon commented 1 year ago

Thank you! I assume the package will be updated with those changes in next publish?