Skip to content

Commit aa6b682

Browse files
akoclaude
andcommitted
fix: INTO clause in CREATE EXTERNAL ENTITIES not routing to target module
Single-part module names like INTO Integration were parsed as a qualifiedName with Module="" and Name="Integration". The visitor extracted .Module (empty) instead of .Name. Now correctly handles single-part qualified names. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3aeb814 commit aa6b682

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

mdl/visitor/visitor_odata.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,17 @@ func (b *Builder) ExitCreateExternalEntitiesStatement(ctx *parser.CreateExternal
211211
ServiceRef: buildQualifiedName(ctx.QualifiedName(0)),
212212
}
213213

214-
// INTO Module or INTO Module.Name (use module part)
214+
// INTO Module — extract target module name
215215
if ctx.INTO() != nil {
216-
if id := ctx.IDENTIFIER(); id != nil {
216+
if ctx.QualifiedName(1) != nil {
217+
qn := buildQualifiedName(ctx.QualifiedName(1))
218+
if qn.Module != "" {
219+
stmt.TargetModule = qn.Module
220+
} else {
221+
stmt.TargetModule = qn.Name // single-part name like "Integration"
222+
}
223+
} else if id := ctx.IDENTIFIER(); id != nil {
217224
stmt.TargetModule = id.GetText()
218-
} else if ctx.QualifiedName(1) != nil {
219-
stmt.TargetModule = buildQualifiedName(ctx.QualifiedName(1)).Module
220225
}
221226
}
222227

0 commit comments

Comments
 (0)