How do I make a per-environment clickhouse SQL UDF? #3282
              
                Unanswered
              
          
                  
                    
                      jwhitaker-gridcog
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment 1 reply
-
| 
         Off the top of my head, I see three possibilities: 
 Do any of these work for you? There is no macro that can be used to peek into the current environment, because using something like that would invalidate the very concept of Virtual Data Environments, since running   | 
  
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys,
I'm using Clickhouse, and I want to pull out some shared code (in this case, JSON parsing) into a UDF. Running as a pre-statement works kind of ok at first glance:
However, Clickhouse has no namespacing of functions to databases. :( So running any sqlmesh environment with this pattern would clobber the same global function
my_function.Any hints how I could do this? is there an off the shelf macro I could use -
create or replace function @suffixize('my_function') as (x) -> stuffWith(x)? any other hints?Beta Was this translation helpful? Give feedback.
All reactions