code: def create_function(self, func, name=None, database=None):
          
          if name is None:
              name = func.name
          database = database or self.current_database
  
          if isinstance(func, udf.ImpalaUDF):
              stmt = ddl.CreateUDF(func, name=name, database=database)
          elif isinstance(func, udf.ImpalaUDA):
              stmt = ddl.CreateUDA(func, name=name, database=database)
          else:
              raise TypeError(func)
          self._execute(stmt)
docs: Creates a function within Impala
  
          Parameters
          ----------
          func : ImpalaUDF or ImpalaUDA
            Created with wrap_udf or wrap_uda
          name : string (optional)
          database : string (optional)