- 
                Notifications
    You must be signed in to change notification settings 
- Fork 239
fix: Fix append regression in 0.13.5 #5495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            max-sixty
  merged 2 commits into
  PRQL:main
from
gosupersimple:fix-5494-append-regression
  
      
      
   
  Oct 31, 2025 
      
    
      
        
          +82
        
        
          −1
        
        
          
        
      
    
  
  
     Merged
                    Changes from 1 commit
      Commits
    
    
            Show all changes
          
          
            2 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            26 changes: 26 additions & 0 deletions
          
          26 
        
  prqlc/prqlc/tests/integration/queries/append_cte_complex.prql
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| prql target:sql.postgres | ||
|  | ||
| let invoices_wrap = ( | ||
| from invoices | ||
| select { invoice_id, billing_country } | ||
| ) | ||
|  | ||
| let employees_wrap = ( | ||
| from employees | ||
| select { employee_id, country } | ||
| ) | ||
|  | ||
| let invoices_final = ( | ||
| from invoices_wrap | ||
| select { invoice_id, billing_country } | ||
| derive { source = f"{billing_country} from invoices" } | ||
| ) | ||
|  | ||
| let employees_final = ( | ||
| from employees_wrap | ||
| select { employee_id, country } | ||
| derive { source = f"{country} from employees" } | ||
| ) | ||
|  | ||
| from invoices_final | ||
| append employees_final | 
        
          
          
            42 changes: 42 additions & 0 deletions
          
          42 
        
  .../prqlc/tests/integration/snapshots/integration__queries__compile__append_cte_complex.snap
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| source: prqlc/prqlc/tests/integration/queries.rs | ||
| expression: "prql target:sql.postgres\n\nlet invoices_wrap = (\n from invoices\n select { invoice_id, billing_country }\n)\n\nlet employees_wrap = (\n from employees\n select { employee_id, country }\n)\n\nlet invoices_final = (\n from invoices_wrap\n select { invoice_id, billing_country }\n derive { source = f\"{billing_country} from invoices\" }\n)\n\nlet employees_final = (\n from employees_wrap\n select { employee_id, country }\n derive { source = f\"{country} from employees\" }\n)\n\nfrom invoices_final\nappend employees_final\n" | ||
| input_file: prqlc/prqlc/tests/integration/queries/append_cte_complex.prql | ||
| snapshot_kind: text | ||
| --- | ||
| WITH invoices_wrap AS ( | ||
| SELECT | ||
| invoice_id, | ||
| billing_country | ||
| FROM | ||
| invoices | ||
| ), | ||
| invoices_final AS ( | ||
| SELECT | ||
| invoice_id, | ||
| billing_country, | ||
| CONCAT(billing_country, ' from invoices') AS source | ||
| FROM | ||
| invoices_wrap | ||
| ), | ||
| employees_wrap AS ( | ||
| SELECT | ||
| employee_id, | ||
| country | ||
| FROM | ||
| employees | ||
| ) | ||
| SELECT | ||
| invoice_id, | ||
| billing_country, | ||
| source | ||
| FROM | ||
| invoices_final | ||
| UNION | ||
| ALL | ||
| SELECT | ||
| employee_id, | ||
| country, | ||
| CONCAT(country, ' from employees') AS source | ||
| FROM | ||
| employees_wrap | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            46 changes: 46 additions & 0 deletions
          
          46 
        
  ...qlc/tests/integration/snapshots/integration__queries__compileall__append_cte_complex.snap
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| --- | ||
| source: prqlc/prqlc/tests/integration/queries.rs | ||
| expression: "prql target:sql.postgres\n\nlet invoices_wrap = (\n from invoices\n select { invoice_id, billing_country }\n)\n\nlet employees_wrap = (\n from employees\n select { employee_id, country }\n)\n\nlet invoices_final = (\n from invoices_wrap\n select { invoice_id, billing_country }\n derive { source = f\"{billing_country} from invoices\" }\n)\n\nlet employees_final = (\n from employees_wrap\n select { employee_id, country }\n derive { source = f\"{country} from employees\" }\n)\n\nfrom invoices_final\nappend employees_final\n" | ||
| input_file: prqlc/prqlc/tests/integration/queries/append_cte_complex.prql | ||
| snapshot_kind: text | ||
| --- | ||
| --- generic | ||
| +++ sqlite | ||
| @@ -2,21 +2,21 @@ | ||
| SELECT | ||
| invoice_id, | ||
| billing_country | ||
| FROM | ||
| invoices | ||
| ), | ||
| invoices_final AS ( | ||
| SELECT | ||
| invoice_id, | ||
| billing_country, | ||
| - CONCAT(billing_country, ' from invoices') AS source | ||
| + billing_country || ' from invoices' AS source | ||
| FROM | ||
| invoices_wrap | ||
| ), | ||
| employees_wrap AS ( | ||
| SELECT | ||
| employee_id, | ||
| country | ||
| FROM | ||
| employees | ||
| ) | ||
| @@ -24,13 +24,13 @@ | ||
| invoice_id, | ||
| billing_country, | ||
| source | ||
| FROM | ||
| invoices_final | ||
| UNION | ||
| ALL | ||
| SELECT | ||
| employee_id, | ||
| country, | ||
| - CONCAT(country, ' from employees') AS source | ||
| + country || ' from employees' AS source | ||
| FROM | ||
| employees_wrap | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.