Skip to content

Commit 3708d24

Browse files
EDsCODEclaude
andcommitted
Fix information_schema transform to skip ducklake catalog references
The compat views query from ducklake.information_schema internally. Without this fix, those queries were also being transformed, creating a circular reference where the view would query itself. Now queries with explicit "ducklake" catalog are passed through unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent fc2a878 commit 3708d24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

transpiler/transform/information_schema.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ func (t *InformationSchemaTransform) walkAndTransform(node *pg_query.Node, chang
6262
case *pg_query.Node_RangeVar:
6363
// Table references: information_schema.columns -> information_schema_columns_compat
6464
// Views are created in the main schema of the current database
65-
if n.RangeVar != nil && strings.EqualFold(n.RangeVar.Schemaname, "information_schema") {
65+
// Skip transformation if catalog is explicitly "ducklake" - those are queries from
66+
// within the compat views that need to access the actual DuckLake information_schema
67+
if n.RangeVar != nil && strings.EqualFold(n.RangeVar.Schemaname, "information_schema") &&
68+
!strings.EqualFold(n.RangeVar.Catalogname, "ducklake") {
6669
relname := strings.ToLower(n.RangeVar.Relname)
6770
if newName, ok := t.ViewMappings[relname]; ok {
6871
n.RangeVar.Relname = newName

0 commit comments

Comments
 (0)