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

Get All projected columns #77

Closed amitharitan closed 2 years ago

amitharitan commented 2 years ago

Hi :) I wish to get all the columns that will be projected as a result from the query (same way getschema works) is there an option to do so using the NuGet?

just to clarify, I wish to get all the columns even if there is no project statement, Like: amitTable | take 1

should return all the columns in amitTable

Thanks in advance, Amit

sloutsky commented 2 years ago

Adding @Matt @.***>

Sent from phone


From: amitharitan @.> Sent: Tuesday, June 7, 2022 6:40:08 PM To: microsoft/Kusto-Query-Language @.> Cc: Subscribed @.***> Subject: [microsoft/Kusto-Query-Language] Get All projected columns (Issue #77)

Hi :) I wish to get all the columns that will be projected as a result from the query (same way getschema works) is there an option to do so using the NuGet?

Thanks in advance, Amit

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FKusto-Query-Language%2Fissues%2F77&data=05%7C01%7CAlexander.Sloutsky%40microsoft.com%7Ccfc8765518ae42e5b71108da489c00de%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637902132127852473%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8hdXrwYU%2BSmVqsQ3kvJDr5mNUcKBM9b07%2Fn9g6egDJY%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEH2NB6PFREBOCRFA6X5GBDVN5UNRANCNFSM5YDMV7JQ&data=05%7C01%7CAlexander.Sloutsky%40microsoft.com%7Ccfc8765518ae42e5b71108da489c00de%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637902132127852473%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wIEX7M30jKmnIeMv%2B3cXEwg6cjYZZBp0GB3Xo8%2B6OVc%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

mattwar commented 2 years ago

If you have a KustoCode instance that is parsed and analyzed, the ResultType property will have a TableSymbol instance that has a collection of Columns.

amitharitan commented 2 years ago

Works! thank you!