Skip to content

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

@cirvine-MSFT

Description

@cirvine-MSFT

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="") 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions