query
table.query.graphql
                                                                                
 Documentation                                                                  
                          Execute a graphql aggregation query against an        
                          (Arrow) table.                                        
                                                                                
                          References: -                                         
                          https://vaex.io/docs/example_graphql.html             
                                                                                
                          Examples: An example for a query could be:            
                                                                                
                          ┌─────────────────────────────────────────────────┐   
                          │     {                                           │   
                          │       df(where: {                               │   
                          │         Language: {_eq: "German"}               │   
                          │       } ) {                                     │   
                          │                                                 │   
                          │         row(limit: 10) {                        │   
                          │           Label                                 │   
                          │           City                                  │   
                          │         }                                       │   
                          │       }                                         │   
                          │     }                                           │   
                          └─────────────────────────────────────────────────┘   
                                                                                
 Origin                                                                         
                          Authors   Markus Binsteiner (markus@frkl.io)          
                                                                                
 Context                                                                        
                          Tags         core                                     
                          Labels       package: kiara_modules.core              
                          References   source_repo:                             
                                       https://github.com/DHARPA-Project/kia…   
                                       documentation:                           
                                       https://dharpa.org/kiara_modules.core/   
                                       module_doc:                              
                                       https://dharpa.org/kiara_modules.core…   
                                       source_url:                              
                                       https://github.com/DHARPA-Project/kia…   
                                                                                
 Module config                                                                  
                          Field       Type     Description           Required   
                         ─────────────────────────────────────────────────────  
                          constants   object   Value constants for   no         
                                               this module.                     
                          defaults    object   Value defaults for    no         
                                               this module.                     
                                                                                
 Module config          -- no config --                                         
 Python class                                                                   
                          class_name    QueryTableGraphQL                       
                          module_name   kiara_modules.core.table.query          
                          full_name     kiara_modules.core.table.query.Query…   
                                                                                
 Processing source code  ─────────────────────────────────────────────────────  
                          def process(self, inputs: ValueSet, outputs: Value…   
                                                                                
                              import vaex                                       
                                                                                
                              table = inputs.get_value_data("table")            
                              query = inputs.get_value_data("query")            
                                                                                
                              df = vaex.from_arrow_table(table)                 
                                                                                
                              result = df.graphql.execute(query)                
                              outputs.set_value("query_result", result.to_di…   
                                                                                
                         ─────────────────────────────────────────────────────  
                                                                                
table.query.sql
                                                                                
 Documentation                                                                  
                          Execute a sql query against an (Arrow) table.         
                                                                                
 Origin                                                                         
                          Authors   Markus Binsteiner (markus@frkl.io)          
                                                                                
 Context                                                                        
                          Tags         core                                     
                          Labels       package: kiara_modules.core              
                          References   source_repo:                             
                                       https://github.com/DHARPA-Project/kia…   
                                       documentation:                           
                                       https://dharpa.org/kiara_modules.core/   
                                       module_doc:                              
                                       https://dharpa.org/kiara_modules.core…   
                                       source_url:                              
                                       https://github.com/DHARPA-Project/kia…   
                                                                                
 Module config                                                                  
                          Field           Type     Description       Required   
                         ─────────────────────────────────────────────────────  
                          constants       object   Value constants   no         
                                                   for this                     
                                                   module.                      
                          defaults        object   Value defaults    no         
                                                   for this                     
                                                   module.                      
                          query           string   The query to      no         
                                                   execute. If not              
                                                   specified, the               
                                                   user will be                 
                                                   able to provide              
                                                   their own.                   
                          relation_name   string   The name the      no         
                                                   table is                     
                                                   referred to in               
                                                   the sql query.               
                                                   If not                       
                                                   specified, the               
                                                   user will be                 
                                                   able to provide              
                                                   their own.                   
                                                                                
 Module config          -- no config --                                         
 Python class                                                                   
                          class_name    QueryTableSQL                           
                          module_name   kiara_modules.core.table.query          
                          full_name     kiara_modules.core.table.query.Query…   
                                                                                
 Processing source code  ─────────────────────────────────────────────────────  
                          def process(self, inputs: ValueSet, outputs: Value…   
                                                                                
                              import duckdb                                     
                                                                                
                              if self.get_config_value("query") is None:        
                                  _query: str = inputs.get_value_data("query…   
                                  _relation_name: str = inputs.get_value_dat…   
                              else:                                             
                                  _query = self.get_config_value("query")       
                                  _relation_name = self.get_config_value("re…   
                                                                                
                              if _relation_name.upper() in RESERVED_SQL_KEYW…   
                                  raise KiaraProcessingException(               
                                      f"Invalid relation name '{_relation_na…   
                                  )                                             
                                                                                
                              _table = inputs.get_value_data("table")           
                              rel_from_arrow = duckdb.arrow(_table)             
                              result: duckdb.DuckDBPyResult = rel_from_arrow…   
                                                                                
                              outputs.set_value("query_result", result.fetch…   
                                                                                
                         ─────────────────────────────────────────────────────