class_docstr: Reuses PrestoEngineSpec functionality.
class_docstr_tok: ["Reuses","PrestoEngineSpec","functionality","."]
docstr: Get a list of function names that are able to be called on the database.
  Used for SQL Lab autocomplete.
  
  :param database: The database to get functions for
  :return: A list of function names useable in the database
docstr_tok: ["Get","a","list","of","function","names","that","are","able","to","be","called","on","the","database",".","Used","for","SQL","Lab","autocomplete",".",":","param","database",":","The","database","to","get","functions","for",":","return",":","A","list","of","function","names","useable","in","the","database"]
code: def get_function_names(cls, database: Database) -> list[str]:
      """
      Get a list of function names that are able to be called on the database.
      Used for SQL Lab autocomplete.
  
      :param database: The database to get functions for
      :return: A list of function names useable in the database
      """
      df = database.get_df("SHOW FUNCTIONS")
      if cls._show_functions_column in df:
          return df[cls._show_functions_column].tolist()
  
      columns = df.columns.values.tolist()
      logger.error(
          "Payload from `SHOW FUNCTIONS` has the incorrect format. "
          "Expected column `%s`, found: %s.",
          cls._show_functions_column,
          ", ".join(columns),
          exc_info=True,
      )
      # if the results have a single column, use that
      if len(columns) == 1:
          return df[columns[0]].tolist()
  
      # otherwise, return no function names to prevent errors
      return []
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import tempfile
  import time
  from datetime import datetime
  from typing import Any, TYPE_CHECKING
  from urllib import parse
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  from flask import current_app, g
  from sqlalchemy import Column, text, types
  from sqlalchemy.engine.base import Engine
  from sqlalchemy.engine.reflection import Inspector
  from sqlalchemy.engine.url import URL
  from sqlalchemy.sql.expression import ColumnClause, Select
  from superset import db
  from superset.common.db_query_status import QueryStatus
  from superset.constants import TimeGrain
  from superset.databases.utils import make_url_safe
  from superset.db_engine_specs.base import BaseEngineSpec
  from superset.db_engine_specs.presto import PrestoEngineSpec
  from superset.exceptions import SupersetException
  from superset.extensions import cache_manager
  from superset.models.sql_lab import Query
  from superset.sql_parse import ParsedQuery, Table
  from superset.superset_typing import ResultSetColumnType
label_desc: Use image node_id 21 for calling the HiveEngineSpec obj's underlying member method code with example usage: obj.get_function_names(cls, database) and returns: list, df, df