class_docstr: Parses a INSERT query into its component parts.
  
  Parameters
  ----------
  query : ast.Insert
      Given SQL INSERT query.
  supported_columns : List[Text], Optional
      List of columns supported by the table for inserting.
  mandatory_columns : List[Text], Optional
      List of columns that must be present in the query for inserting.
  all_mandatory : Optional[Any], Optional (default=True)
      Whether all mandatory columns must be present in the query. If False, only one of the mandatory columns must be present.
docstr: Parses the columns in the query. Raises an exception if the columns are not supported or if mandatory columns are missing.
docstr_tok: ["Parses","the","columns","in","the","query",".","Raises","an","exception","if","the","columns","are","not","supported","or","if","mandatory","columns","are","missing","."]
code: def parse_columns(self):
      """
      Parses the columns in the query. Raises an exception if the columns are not supported or if mandatory columns are missing.
      """
      columns = [col.name for col in self.query.columns]
  
      if self.supported_columns:
          if not set(columns).issubset(self.supported_columns):
              unsupported_columns = set(columns).difference(
                  self.supported_columns
              )
              raise UnsupportedColumnException(
                  f"Unsupported columns: {', '.join(unsupported_columns)}"
              )
  
      if self.mandatory_columns:
          if self.all_mandatory:
              if not set(self.mandatory_columns).issubset(columns):
                  missing_mandatory_columns = set(
                      self.mandatory_columns
                  ).difference(columns)
                  raise MandatoryColumnException(
                      f"Mandatory columns missing: {', '.join(missing_mandatory_columns)}"
                  )
          else:
              if not set(self.mandatory_columns).intersection(columns):
                  missing_mandatory_columns = set(
                      self.mandatory_columns
                  ).difference(columns)
                  raise MandatoryColumnException(
                      f"Mandatory columns missing: {', '.join(missing_mandatory_columns)}"
                  )
  
      return columns
  
imports: from mindsdb_sql.parser import ast
  from typing import Text, List, Dict, Any, Optional
  from .exceptions import UnsupportedColumnException, MandatoryColumnException, ColumnCountMismatchException
label_desc: Use image node_id 3 for calling the INSERTQueryParser obj's underlying member method code with example usage: obj.parse_columns() and returns: columns