Skip to content

Commit c0eab45

Browse files
committed
Add standalone HASH support for inline index definitions
Handle HASH keyword without preceding NONCLUSTERED in table-level inline index definitions. When HASH appears directly after UNIQUE, it is now correctly interpreted as NonClusteredHash index type.
1 parent b2cb43e commit c0eab45

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

parser/parse_statements.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ func (p *Parser) parseInlineIndexDefinition() (*ast.IndexDefinition, error) {
479479
// Implicit NONCLUSTERED COLUMNSTORE
480480
indexDef.IndexType = &ast.IndexType{IndexTypeKind: "NonClusteredColumnStore"}
481481
p.nextToken()
482+
} else if strings.ToUpper(p.curTok.Literal) == "HASH" {
483+
// Implicit NONCLUSTERED HASH
484+
indexDef.IndexType = &ast.IndexType{IndexTypeKind: "NonClusteredHash"}
485+
p.nextToken()
482486
}
483487

484488
// Parse column list
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}

0 commit comments

Comments
 (0)