Find all the tables used in the query in FROM clause (from columns, criterias and orders).

@return List of {@link Table}s
507362
private List<Table> findAllUsedTablesInFrom() {
        List<Table> allTables = new ArrayList<Table>();
        Map<Table, List<JoinCriteria>> sourceMap = new HashMap<Table, List<JoinCriteria>>();
        Map<Table, List<JoinCriteria>> destMap = new HashMap<Table, List<JoinCriteria>>();
        
        // see what tables are used in outer joins        
        for (Object criteria : criterias) {
            try {
                JoinCriteria joinCriteria = (JoinCriteria) criteria;
                Table sourceTable = joinCriteria.getSource().getTable();
                Table destTable = joinCriteria.getDestination().getTable();
                List<JoinCriteria> sourceList = sourceMap.get(sourceTable);
                List<JoinCriteria> destList = sourceMap.get(destTable);
                if (sourceList == null) {
                	sourceList = new ArrayList<JoinCriteria>();
                	sourceMap.put(sourceTable, sourceList);
                }
                sourceList.add(joinCriteria);        
                if (destList == null) {
                	destList = new ArrayList<JoinCriteria>();
                	destMap.put(destTable, destList);
                }
                destList.add(joinCriteria);        
            } catch (ClassCastException ex) {
                // not a JoinCriteria
            }
        }    
        
        // add tables from column selection
        for (Column column : columns) {
            Table table = column.getTable();
            if (table != null) {
                table.setDialect(dialect);
            }
            if (canAddTableToFromClause(table, destMap, allTables)) {
            	table.setJoins(sourceMap.get(table));
        		allTables.add(table);
        	}    
        }        
        
        // add tables from criterias 
        // it is possible that a table is used only in joins without any column selection from it
        for (Object criteria : criterias) {
            try {            	
                JoinCriteria joinCriteria = (JoinCriteria) criteria;
                Table sourceTable = joinCriteria.getSource().getTable();
                Table destTable = joinCriteria.getDestination().getTable();
                if (canAddTableToFromClause(sourceTable, destMap, allTables)) {
                	sourceTable.setJoins(sourceMap.get(sourceTable));
            		allTables.add(sourceTable);
            	}                
                if (canAddTableToFromClause(destTable, destMap, allTables)) {
                	destTable.setJoins(destMap.get(destTable));
                    allTables.add(destTable);
                }                                 
            } catch (ClassCastException ex) {
                // not a JoinCriteria
            }
        }

        // add tables used by order columns
        for (Order order : orders) {
            Table table = order.getColumn().getTable();
            if (table != null) {
                table.setDialect(dialect);
            }
            if (canAddTableToFromClause(table, destMap, allTables)) {
                allTables.add(table);
            }
        }

        return allTables;
    }
34909
public java.util.List<String> getImportTablesCompleted() {
        if (importTablesCompleted == null) {
            importTablesCompleted = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return importTablesCompleted;
    }
248813
public List<String> getFeatureTables() throws SQLException {

		List<String> tableNames = new ArrayList<String>();

		List<GeometryColumns> geometryColumns = queryForAll();
		for (GeometryColumns geometryColumn : geometryColumns) {
			tableNames.add(geometryColumn.getTableName());
		}

		return tableNames;
	}
1100720
public static List<String> getTables(DataSource ds, String schema, String tableName, TableType... types) {
		final List<String> tables = new ArrayList<String>();
		Connection conn = null;
		ResultSet rs = null;
		try {
			conn = ds.getConnection();
			final DatabaseMetaData metaData = conn.getMetaData();
			rs = metaData.getTables(conn.getCatalog(), schema, tableName, Convert.toStrArray(types));
			if (rs == null) {
				return null;
			}
			String table;
			while (rs.next()) {
				table = rs.getString("TABLE_NAME");
				if (StrUtil.isNotBlank(table)) {
					tables.add(table);
				}
			}
		} catch (Exception e) {
			throw new DbRuntimeException("Get tables error!", e);
		} finally {
			DbUtil.close(rs, conn);
		}
		return tables;
	}
1053674
def all_tables(self) -> List[str]:
        
        return sorted([k for k in self.__dict__.keys()
                       if k not in _I2B2Tables._funcs and not k.startswith("_")])
1011244
public java.util.List<DBInstance> getDBInstances() {
        if (dBInstances == null) {
            dBInstances = new com.amazonaws.internal.SdkInternalList<DBInstance>();
        }
        return dBInstances;
    }
1243226
@Override
	public List<String> getSqlPathList() {
		List<String> list = Collections.list(this.sqlInfos.keys());
		Collections.sort(list);
		return list;
	}
415357
public List<SqlResultSetMapping<OrmDescriptor>> getAllSqlResultSetMapping()
   {
      List<SqlResultSetMapping<OrmDescriptor>> list = new ArrayList<SqlResultSetMapping<OrmDescriptor>>();
      List<Node> nodeList = model.get("sql-result-set-mapping");
      for(Node node: nodeList)
      {
         SqlResultSetMapping<OrmDescriptor>  type = new SqlResultSetMappingImpl<OrmDescriptor>(this, "sql-result-set-mapping", model, node);
         list.add(type);
      }
      return list;
   }
1355759
public function getTablesForSql()
    {
        $tables = [];
        foreach ($this->tables as $table) {
            if (!$table->isSkipSql()) {
                $tables[] = $table;
            }
        }

        return $tables;
    }
439888
private List<String> getFedoraTables() {
        try {
            InputStream in =
                    getClass().getClassLoader()
                            .getResourceAsStream(DBSPEC_LOCATION);
            List<TableSpec> specs = TableSpec.getTableSpecs(in);
            ArrayList<String> names = new ArrayList<String>();
            for (TableSpec spec: specs) {
                names.add(spec.getName().toUpperCase());
            }
            return names;
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException("Unexpected error reading dbspec file",
                                       e);
        }
    }
994921
public java.util.List<String> getImportTablesNotStarted() {
        if (importTablesNotStarted == null) {
            importTablesNotStarted = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return importTablesNotStarted;
    }
365005
public Set<String> getTableNamesInvolvedInEntity() {
        Set<String> tableNames = newTreeSet();

        for (Attribute attribute : getCurrentAttributes()) {
            tableNames.add(attribute.getTableName());
        }

        return tableNames;
    }
1365434
public List<List<String>> getTableAsList(final By tableBy) {
		List<List<String>> all = new ArrayList<List<String>>();
		WebElement table = driver.findElement(tableBy);

		List<WebElement> rows = table.findElements(By.tagName("tr"));
		for (WebElement row : rows) {
			List<String> toAdd = new ArrayList<String>();
			List<WebElement> columns = row.findElements(By.tagName("td"));
			for (WebElement column : columns) {
				toAdd.add(column.getText());
			}
			all.add(toAdd);
		}
		return all;
	}
138912
def get_table_columns(self):
        """"""
        query = 'SELECT * FROM "{schema}"."{table}" limit 0'.format(table=self.table_name, schema=self.schema)
        return get_columns(self.cc, query)
1262669
public List<Table> asTableList() {
        List<Table> tableList = new ArrayList<>();
        for (TableSlice view : this) {
            tableList.add(view.asTable());
        }
        return tableList;
    }
1310738
private List<SchemaColumn> findPartitioningColumns() {
        if (m_partitioningColumns != null) {
            return m_partitioningColumns;
        }

        m_partitioningColumns = new ArrayList<>();
        assert(getScanPartitioning() != null);

        if (getScanPartitioning().getCountOfPartitionedTables() > 0) {
            for (StmtTableScan tableScan : m_subqueryStmt.allScans()) {
                List<SchemaColumn> scols = tableScan.getPartitioningColumns();
                if (scols != null) {
                    addPartitioningColumns(scols);
                }
            }
        }
        return m_partitioningColumns;
    }
72205
public java.util.List<DBClusterEndpoint> getDBClusterEndpoints() {
        if (dBClusterEndpoints == null) {
            dBClusterEndpoints = new com.amazonaws.internal.SdkInternalList<DBClusterEndpoint>();
        }
        return dBClusterEndpoints;
    }