You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.create-or-alter function testfunction() { let temp = random_table_with_timestamp | distinct timestamp=bin(timestamp,1m); temp }
When the application attempts to parse the above command it craps out. Debugging a bit, it appears to be an issue with distinct with a column name assignment and/or the bin() function. Regardless, I can work around this by refactoring my code, but has to download code and test locally before I could figure out what the issue was. If other people try to use this and have similar syntax, it breaks. Yes, there are many ways to re-write this query so that I don't have the assignment or the bin function with distinct.. But if it works in Kusto Explorer and on ADX, I think it should work when being valid when parsing.
Fix is probably going to be an upgrade to the Microsoft.Azure.Kusto.Language package...
Full StackTrace
System.InvalidOperationException
HResult=0x80131509
Message=Function body was expected to be surrounded by curly brace but isn't: { let temp = random_table_with_timestamp | distinct timestamp=bin(timestamp,1m
Source=DeltaKustoLib
StackTrace:
at DeltaKustoLib.CommandModel.CreateFunctionCommand.TrimFunctionSchemaBody(String body) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CreateFunctionCommand.cs:line 262
at DeltaKustoLib.CommandModel.CreateFunctionCommand.FromCode(SyntaxElement rootElement) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CreateFunctionCommand.cs:line 66
at DeltaKustoLib.CommandModel.CommandBase.CreateCommand(String script, KustoCode code, Boolean ignoreUnknownCommands) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CommandBase.cs:line 104
at DeltaKustoLib.CommandModel.CommandBase.ParseAndCreateCommand(String script, Boolean ignoreUnknownCommands) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CommandBase.cs:line 65
This exception was originally thrown at this call stack:
DeltaKustoLib.CommandModel.CreateFunctionCommand.TrimFunctionSchemaBody(string) in CreateFunctionCommand.cs
DeltaKustoLib.CommandModel.CreateFunctionCommand.FromCode(Kusto.Language.Syntax.SyntaxElement) in CreateFunctionCommand.cs
DeltaKustoLib.CommandModel.CommandBase.CreateCommand(string, Kusto.Language.KustoCode, bool) in CommandBase.cs
DeltaKustoLib.CommandModel.CommandBase.ParseAndCreateCommand(string, bool) in CommandBase.cs
The text was updated successfully, but these errors were encountered:
I have a function that is using logic like this:
.create-or-alter function testfunction() { let temp = random_table_with_timestamp | distinct timestamp=bin(timestamp,1m); temp }
When the application attempts to parse the above command it craps out. Debugging a bit, it appears to be an issue with distinct with a column name assignment and/or the bin() function. Regardless, I can work around this by refactoring my code, but has to download code and test locally before I could figure out what the issue was. If other people try to use this and have similar syntax, it breaks. Yes, there are many ways to re-write this query so that I don't have the assignment or the bin function with distinct.. But if it works in Kusto Explorer and on ADX, I think it should work when being valid when parsing.
Fix is probably going to be an upgrade to the Microsoft.Azure.Kusto.Language package...
Full StackTrace
System.InvalidOperationException
HResult=0x80131509
Message=Function body was expected to be surrounded by curly brace but isn't: { let temp = random_table_with_timestamp | distinct timestamp=bin(timestamp,1m
Source=DeltaKustoLib
StackTrace:
at DeltaKustoLib.CommandModel.CreateFunctionCommand.TrimFunctionSchemaBody(String body) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CreateFunctionCommand.cs:line 262
at DeltaKustoLib.CommandModel.CreateFunctionCommand.FromCode(SyntaxElement rootElement) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CreateFunctionCommand.cs:line 66
at DeltaKustoLib.CommandModel.CommandBase.CreateCommand(String script, KustoCode code, Boolean ignoreUnknownCommands) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CommandBase.cs:line 104
at DeltaKustoLib.CommandModel.CommandBase.ParseAndCreateCommand(String script, Boolean ignoreUnknownCommands) in C:\Users\bob\Source\Repos\delta-kusto\code\DeltaKustoLib\CommandModel\CommandBase.cs:line 65
This exception was originally thrown at this call stack:
DeltaKustoLib.CommandModel.CreateFunctionCommand.TrimFunctionSchemaBody(string) in CreateFunctionCommand.cs
DeltaKustoLib.CommandModel.CreateFunctionCommand.FromCode(Kusto.Language.Syntax.SyntaxElement) in CreateFunctionCommand.cs
DeltaKustoLib.CommandModel.CommandBase.CreateCommand(string, Kusto.Language.KustoCode, bool) in CommandBase.cs
DeltaKustoLib.CommandModel.CommandBase.ParseAndCreateCommand(string, bool) in CommandBase.cs
The text was updated successfully, but these errors were encountered: