presto-cli/src/main/java/io/prestosql/cli/TableNameCompleter.java/TableNameCompleter/complete
class TableNameCompleter:    @Override
    public void complete(LineReader reader, ParsedLine line, List<Candidate> candidates)
    {
        String buffer = line.word().substring(0, line.wordCursor());
        int blankPos = findLastBlank(buffer);
        String prefix = buffer.substring(blankPos + 1);
        String schemaName = queryRunner.getSession().getSchema();

        if (schemaName != null) {
            List<String> functionNames = functionCache.getIfPresent(schemaName);
            List<String> tableNames = tableCache.getIfPresent(schemaName);

            if (functionNames != null) {
                for (String name : filterResults(functionNames, prefix)) {
                    candidates.add(new Candidate(name));
                }
            }
            if (tableNames != null) {
                for (String name : filterResults(tableNames, prefix)) {
                    candidates.add(new Candidate(name));
                }
            }
        }
    }