Gets the fully-qualified index metrics table name for the given table.

@param schema Schema name
@param table Table name
@return Qualified index metrics table name
420403
public static String getMetricsTableName(String schema, String table)
    {
        return schema.equals("default") ? table + "_idx_metrics"
                : schema + '.' + table + "_idx_metrics";
    }
1173907
public function getColumns($table, $schema = null)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string')->test(2, 'string', 'null');
        
        $select = array(
            'columns.table_schema',
            'columns.column_name',
            'columns.ordinal_position',
            'columns.column_default',
            'columns.is_nullable',
            'columns.data_type',
            'columns.character_maximum_length',
            'columns.character_octet_length',
            'pg_class2.relname AS index_type');
        
        $where = array(
            "pg_attribute.attrelid = pg_class1.oid AND pg_class1.relname='".$table."'",
            'columns.column_name = pg_attribute.attname AND columns.table_name=pg_class1.relname',
            'pg_class1.oid = pg_index.indrelid AND pg_attribute.attnum = ANY(pg_index.indkey)',
            'pg_class2.oid = pg_index.indexrelid');
        
        if ($schema) {
            $where[1] .= ' AND columns.table_schema="'.$schema.'"';
        }
        
        $query = Select::i()
            ->select($select)
            ->from('pg_attribute')
            ->innerJoin('pg_class AS pg_class1', $where[0], false)
            ->innerJoin('information_schema.COLUMNS	AS columns', $where[1], false)
            ->leftJoin('pg_index', $where[2], false)
            ->leftJoin('pg_class AS pg_class2', $where[3], false)
            ->getQuery();
        
        $results = $this->query($query);
        
        $columns = array();
        foreach ($results as $column) {
            $key = null;
            if (strpos($column['index_type'], '_pkey') !== false) {
                $key = 'PRI';
            } else if (strpos($column['index_type'], '_key') !== false) {
                $key = 'UNI';
            }
            
            $columns[] = array(
                'Field'     => $column['column_name'],
                'Type'      => $column['data_type'],
                'Default'   => $column['column_default'],
                'Null'      => $column['is_nullable'],
                'Key'       => $key);
        }
        
        return $columns;
    }
1274041
def table_schema_call(self, target, cls):
        
        index_defs = []
        for name in cls.index_names() or []:
            index_defs.append(GlobalIncludeIndex(
                gsi_name(name),
                parts=[HashKey(name)],
                includes=['value']
            ))

        return target(
            cls.get_table_name(),
            connection=get_conn(),
            schema=[HashKey('id')],
            global_indexes=index_defs or None
        )
267126
public Table findUserTable(Session session, String name,
                               String schemaName) {

        Schema schema = (Schema) schemaMap.get(schemaName);

        if (schema == null) {
            return null;
        }

        if (session != null) {
            Table table = session.getLocalTable(name);
            if (table != null) {
                return table;
            }
        }

        int i = schema.tableList.getIndex(name);

        if (i == -1) {
            return null;
        }

        return (Table) schema.tableList.get(i);
    }
179976
private static <T> String getTableName(Class<T> clazz) {
		
		Table tableAnno = clazz.getAnnotation(Table.class);
		if(tableAnno != null){
			if(tableAnno.catalog() != null){
				return tableAnno.catalog() + "." + tableAnno.name();
			}
			return tableAnno.name();
		}
		//if Table annotation is null
		String className = clazz.getName();
		return IdUtils.toUnderscore(className.substring(className.lastIndexOf(".")+1));
	}
245073
def get_table_names(self, connection, schema=None, **kw):
        
        return self._get_table_or_view_names('r', connection, schema, **kw)
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;
	}
1185110
int getTableIndex(Table table) {

        Schema schema = (Schema) schemaMap.get(table.getSchemaName().name);

        if (schema == null) {
            return -1;
        }

        HsqlName name = table.getName();

        return schema.tableList.getIndex(name.name);
    }
464298
public function getIndexes($table, $schema = null)
    {
        $select = [
            'columns.column_name',
            'pg_class2.relname AS index_type'
        ];
        
        $where = [
            "pg_attribute.attrelid = pg_class1.oid AND pg_class1.relname='".$table."'",
            'columns.column_name = pg_attribute.attname AND columns.table_name=pg_class1.relname',
            'pg_class1.oid = pg_index.indrelid AND pg_attribute.attnum = ANY(pg_index.indkey)',
            'pg_class2.oid = pg_index.indexrelid'
        ];
        
        if ($schema) {
            $where[1] .= ' AND columns.table_schema="'.$schema.'"';
        }
        
        $query = $this
            ->getSelectQuery($select)
            ->from('pg_attribute')
            ->innerJoin('pg_class AS pg_class1', $where[0], false)
            ->innerJoin('information_schema.COLUMNS    AS columns', $where[1], false)
            ->innerJoin('pg_index', $where[2], false)
            ->innerJoin('pg_class AS pg_class2', $where[3], false)
            ->getQuery();
            
        return $this->query($query);
    }
1185971
public function getTableSchema($table)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $backup = array();
        //get the schema
        $schema = $this->getColumns($table);
        if (count($schema)) {
            //lets rebuild this schema
            $query = $this->create()->setName($table);
            foreach ($schema as $field) {
                //first try to parse what we can from each field
                $fieldTypeArray = explode(' ', $field['Type']);
                $typeArray = explode('(', $fieldTypeArray[0]);
                
                $type = $typeArray[0];
                $length = str_replace(')', '', $typeArray[1]);
                $attribute = isset($fieldTypeArray[1]) ? $fieldTypeArray[1] : null;
                
                $null = strtolower($field['Null']) == 'no' ? false : true;
                
                $increment = strtolower($field['Extra']) == 'auto_increment' ? true : false;
                
                //lets now add a field to our schema class
                $q->addField($field['Field'], array(
                    'type'              => $type,
                    'length'            => $length,
                    'attribute'         => $attribute,
                    'null'              => $null,
                    'default'           => $field['Default'],
                    'auto_increment'    => $increment));
                
                //set keys where found
                switch ($field['Key']) {
                    case 'PRI':
                        $query->addPrimaryKey($field['Field']);
                        break;
                    case 'UNI':
                        $query->addUniqueKey($field['Field'], array($field['Field']));
                        break;
                    case 'MUL':
                        $query->addKey($field['Field'], array($field['Field']));
                        break;
                }
            }
            
            //store the query but dont run it
            $backup[] = $query;
        }
        
        //get the rows
        $rows = $this->query($this->select->from($table)->getQuery());
        
        if (count($rows)) {
            //lets build an insert query
            $query = $this->insert($table);
            foreach ($rows as $index => $row) {
                foreach ($row as $key => $value) {
                    $query->set($key, $this->getBinds($value), $index);
                }
            }
            
            //store the query but dont run it
            $backup[] = $query->getQuery(true);
        }
        
        return implode("\n\n", $backup);
    }
462884
private Referenceable getTableReference(Table hiveTable)  throws Exception {
        LOG.debug("Getting reference for table {}.{}", hiveTable.getDbName(), hiveTable.getTableName());

        String typeName = HiveDataTypes.HIVE_TABLE.getName();
        String tblQualifiedName = getTableQualifiedName(getClusterName(), hiveTable.getDbName(), hiveTable.getTableName());
        return getEntityReference(typeName, tblQualifiedName);
    }
833618
@Override
	public String onColumnFullyQualifiedName(String tableName, String columnName) {
		if (onlyBindParameter)
			return null;

		return JQLReplacerListenerImpl.resolveFullyQualifiedColumnName(currentSchema, currentMethod, tableName, columnName);
	}
134390
private static Set<String> getIndexedColumnSetForTable(Table table) {
        HashSet<String> columns = new HashSet<>();

        for (Index index : table.getIndexes()) {
            for (ColumnRef colRef : index.getColumns()) {
                columns.add(colRef.getColumn().getTypeName());
            }
        }

        return columns;
    }
1299262
@Override
    public String getName() {
        final String tableNamePrefix = StringUtils.isNotBlank(Latkes.getLocalProperty("jdbc.tablePrefix"))
                ? Latkes.getLocalProperty("jdbc.tablePrefix") + "_"
                : "";

        return tableNamePrefix + name;
    }
349119
private static String debugSchema(JMFSchema schema) {
    if (schema != null)
      return schema.getName() + "(" + Long.toHexString(schema.getID()) + ")";
    else
      return "<null>";
  }
484402
private TableDefinition determineTableFromFileName(String fileName) {
        ApplicationDefinition appDef = m_session.getAppDef();
        for (String tableName : m_tableNameList) {
            if (fileName.regionMatches(true, 0, tableName, 0, tableName.length())) {
                return appDef.getTableDef(tableName);
            }
        }
        return null;
    }
421223
public TableIndex getTableIndex() {

		TableIndex tableIndex = null;
		try {
			if (tableIndexDao.isTableExists()) {
				tableIndex = tableIndexDao.queryForId(tableName);
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to query for Table Index for GeoPackage: "
							+ geoPackage.getName() + ", Table Name: "
							+ tableName + ", Column Name: " + columnName, e);
		}
		return tableIndex;
	}