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

Executing '.show databases' via Mgmt call returns nothing but outputs error. #11

Closed
patrickbsf opened this issue Mar 13, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@patrickbsf
Copy link

It outputs

Error: Op(OpMgmt): Kind(KInternal): DataTable.Columns had entry with .ColumnType set to a <nil> type

on the screen but doesn't actually return an error. There are apparently still cases where Kusto returns aren't being translated properly.

This is with the 0.1 pre-release.

@element-of-surprise
Copy link
Member

Was able to replicate.

Tracked this down to being a translation of V1 frame type information. Mgmt uses the v1 frames, which output column type data in every frame. That type data has two different fields to describe the column data:

  • ColumnType
  • DataType

DataType is the .Net equivalent name. ColumnType is the Kusto name. But most of the time ColumnType is empty and we have to translate off the DataType.

There was a bad assumption on some of the names, so we were not translating "boolean" into Bool. I added translation for every name and alias listed in the docs.

Our internal integration tests were exclusively using Mgmt() for making changes and not reading data, hermetic tests of course wouldn't catch this if our assumptions were wrong. Added a regression in the integration tests.

Made the error drop more relevant information related to this problem. Haven't tracked why this error wasn't returned and displayed yet.

Will update soonish.

@element-of-surprise
Copy link
Member

on the screen but doesn't actually return an error.

Iter.Do(), when replicated returns an error and does not make calls to log. Since there are a few paths you could be doing, want to make sure we cover the right one.

Can you output the Mgmt() call + iteration code?

@element-of-surprise element-of-surprise self-assigned this Mar 14, 2020
@element-of-surprise element-of-surprise added the bug Something isn't working label Mar 14, 2020
@patrickbsf
Copy link
Author

Ah, got it. I misspoke. An error is returned, but not from Mgmt (which is correct). It's returning from the Next() call [where the parsing is occurring].

It's a very simple test program where I iterate through a variety of commands to pass through to Mgmt, see what errors come back,interrogate the rows, etc.

It's basically:

		rows, err := kustoClient.Mgmt(ctx, db, ddl)
		if err != nil {
			fmt.Println("Mgmt Error:", err)
			break
		}

		for {
			row, err := rows.Next()
			if err != nil {
				if err == io.EOF {
					break
				}
				fmt.Println("Row Error:", err)
				break
			}
			fmt.Printf("%#v\n", row)
		}

..and the output is:
Row Error: Op(OpMgmt): Kind(KInternal): DataTable.Columns had entry with .ColumnType set to a type

Which means an error from Mgmt itself wasn't returned, but the ColumnType error was returned from the first rows.Next() call.

@element-of-surprise
Copy link
Member

Thanks for that. That confirms we are getting an error output and there wasn't another issue.

I've pushed out a release 0.1.1 that addresses this issue.

Any further problems on this issue, please feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants