@classmethod
  def get_nested_select(cls, database, table, column, nested=None):
    select_tokens = [column]
    from_tokens = [database, table]

    if nested:
      nested_tokens = nested.strip('/').split('/')
      while nested_tokens:
        token = nested_tokens.pop(0)
        if token not in ['key', 'value', 'item']:
          select_tokens.append(token)
        else:
          # if we encounter a reserved keyword, move current select_tokens to from_tokens and reset the select_tokens
          from_tokens.extend(select_tokens)
          select_tokens = []
          # if reserved keyword is the last token, make it the only select_token, otherwise we ignore and continue
          if not nested_tokens:
            select_tokens = [token]

    select_clause = '.'.join(select_tokens)
    from_clause = '.'.join('`%s`' % token for token in from_tokens)
    return select_clause, from_clause
True when this is a regular file.
dataset/ETHPy150Open cloudera/hue/apps/impala/src/impala/dbms.py/ImpalaDbms.get_nested_select--crossover with--dataset/ETHPy150Open jonathanslenders/python-deployer/deployer/host/base.py/Stat.is_file