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

Columns with numeric names are not escaped using ['<name>'] syntax #177

Open
cirvine-MSFT opened this issue Sep 17, 2024 · 1 comment
Open

Comments

@cirvine-MSFT
Copy link

Some of the tables we work with have numeric column names (e.g. "1" or "0"). We found that delta-kusto does not escape these names appropriately and the commands that are produced or syntatically invalid.

For example, delta-kusto will produce this command

.create-merge table TableWithNumberColumns (0:string, 1:string, ['foo']:string) with (folder="", docstring="") 

When it should be

.create-merge table TableWithNumberColumns (['0']:string, ['1']:string, ['foo']:string) with (folder="", docstring="") 

Full steps to reproduce the issue:

Starting with a database called logs, create a table using this command

.create table TableWithNumberColumns (['0']:string, ['1']:string, foo:string)

Create a parameter file for delta-kusto that will pull the state of the database

failIfDataLoss: true
jobs:
  GetSnapshot:
    target:
      adx:
        clusterUri: to-override
        database: logs
    action:
      pushToConsole: false
      filePath:  logs-delta.kql
tokenProvider:
  azCli: 
    interactive: true

delta-kusto produces a delta file that looks like

//  Create tables

.create-merge table TableWithNumberColumns (0:string, 1:string, ['foo']:string) with (folder="", docstring="") 

Expected that the columns 0, and 1 would be escaped

//  Create tables

.create-merge table TableWithNumberColumns (['0']:string, ['1']:string, ['foo']:string) with (folder="", docstring="") 
@cirvine-MSFT
Copy link
Author

I'm planning on working on a fix for this, please feel free to assign to me.

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

1 participant