Skip to content

[BUG] #623

@jeffreyaven

Description

@jeffreyaven

Describe the bug
The || string concatenation operator fails when used in a query against a view, but works correctly against a resource. The error returned is:

query rewriting for indirection: cannot find col = ''

To Reproduce

Run the following against the homebrew provider (free, no auth required):

SELECT 
  'homebrew://' || formula_name as formula_uri
FROM  
  homebrew.formula.vw_info
WHERE formula_name = 'stackql';

The same query pattern works correctly against a resource:

SELECT 
  'homebrew://' || name as formula_uri
FROM  
  homebrew.formula.formula
WHERE formula_name = 'stackql';

Expected behavior

Both queries return a single row with formula_uri = 'homebrew://stackql'.

Additional context

Assigned to @claude for investigation and fix.

  • Fix should be isolated to the query rewriter's indirection/column resolution logic - the bug is that string literal operands on the left side of || are not being resolved correctly during view expansion
  • Fix should touch as few files as possible with no refactoring of adjacent logic
  • Add both queries above as robot framework regression tests to the existing homebrew test suite, with the resource query as baseline and the view query as the regression guard

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions