Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateFunctionCommand fails on functions with empty lines #142

Closed
maschAtWork opened this issue Aug 22, 2023 · 1 comment
Closed

CreateFunctionCommand fails on functions with empty lines #142

maschAtWork opened this issue Aug 22, 2023 · 1 comment

Comments

@maschAtWork
Copy link

maschAtWork commented Aug 22, 2023

Attempting to create a function via ParseAndCreateCommand fails when the parsed function has empty lines. I was able to repro the failure, which is thrown from CreateFunctionCommand::TrimFunctionSchemaBody, with the below function.

.create-or-alter function aa()
{

// something
range dateHour from 1d to 10d step 1d
}

The issue appears to be upstream from CreateFunctionCommand, potentially in KustoCode.Parse, which only parses ".create-or-alter function with (skipvalidation = \"true\") aa() {". Is this empty line behavior expected? If so, should the fix be made in Kusto.Language package?

@vplauzon
Copy link
Contributor

Delta Kusto assumes each command is separated with one (or many) empty lines. So it breaks a script into commands by the empty lines.

Having an empty line in a function therefore... breaks its algorithm (no pun intended).

Workaround would be to remove those empty lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants