/* (non-Javadoc)
@see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String)
175509
@Override
  public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName,
      String schemaName)
          throws HiveSQLException {
    try {
      TGetSchemasReq req = new TGetSchemasReq(sessionHandle.toTSessionHandle());
      req.setCatalogName(catalogName);
      req.setSchemaName(schemaName);
      TGetSchemasResp resp = cliService.GetSchemas(req);
      checkStatus(resp.getStatus());
      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
      return new OperationHandle(resp.getOperationHandle(), protocol);
    } catch (HiveSQLException e) {
      throw e;
    } catch (Exception e) {
      throw new HiveSQLException(e);
    }
  }
372459
function getSchema(connection) {
  const schemaSql = getSchemaSql(connection.database);
  return runQuery(schemaSql, connection).then(queryResult =>
    formatSchemaQueryResults(queryResult)
  );
}
907728
@Override
    @GraphTransaction
    public String getSchema(String datasetName) throws AtlasException {
        datasetName = ParamChecker.notEmpty(datasetName, "table name");
        LOG.info("Fetching schema for tableName={}", datasetName);
        TypeUtils.Pair<String, String> typeIdPair = validateDatasetNameExists(datasetName);

        return getSchemaForId(typeIdPair.left, typeIdPair.right);
    }
733274
static void loadSchemas(MessageStore msgStore, long[] schemaIds) throws MessageRestoreFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "loadSchemas");
    try {
      // Get the SchemaStore reference, creating a new one if necessary
      SchemaStoreItemStream schemaStore = getSchemaStore(msgStore);

      // Check for any unknown schemas
      for (int i = 0; i < schemaIds.length; i++) {
        if (JMFRegistry.instance.retrieve(schemaIds[i]) == null) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Restoring schema:" + schemaIds[i]);
          JMFRegistry.instance.register(schemaStore.findSchema(schemaIds[i]));
        }
      }
    } catch (MessageStoreException e) {
      FFDCFilter.processException(e, "loadSchemas", "105");
      throw new MessageRestoreFailedException(e);
    } catch (JMFException e) {
      FFDCFilter.processException(e, "loadSchemas", "108");
      throw new MessageRestoreFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "loadSchemas");
  }
916349
function readGetSchema(message, tokens) {
	message.userName = protocol.decodeString(tokens[1]);
	message.groupName = protocol.decodeString(tokens[3]);
	message.schemaName = protocol.decodeString(tokens[5]);
	message.sessionId = protocol.decodeString(tokens[7]);
}
817501
@Override
    public String[] getValueNames() {
        if (isInvalid()) {
            throw new IllegalStateException("Session is invalid");
        }
        Set<String> keys = this.attributes.keySet();
        return keys.toArray(new String[keys.size()]);
    }
151120
protected TableSchema getSchema() {
    List<TableFieldSchema> fields = new ArrayList<>();
    for (Map.Entry<String, FieldInfo<InputT>> entry : fieldInfo.entrySet()) {
      String key = entry.getKey();
      FieldInfo<InputT> fcnInfo = entry.getValue();
      String bqType = fcnInfo.getFieldType();
      fields.add(new TableFieldSchema().setName(key).setType(bqType));
    }
    return new TableSchema().setFields(fields);
  }
40556
public java.util.List<SchemaExtensionInfo> getSchemaExtensionsInfo() {
        if (schemaExtensionsInfo == null) {
            schemaExtensionsInfo = new com.amazonaws.internal.SdkInternalList<SchemaExtensionInfo>();
        }
        return schemaExtensionsInfo;
    }
487672
protected void exportSchema(final String persistenceUnit, List<TableInfo> tables)
    {
        // Get persistence unit metadata
        this.puMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit);
        String paramString = externalProperties != null ? (String) externalProperties
                .get(PersistenceProperties.KUNDERA_CLIENT_FACTORY) : null;
        if (clientFactory != null
                && ((clientFactory.equalsIgnoreCase(puMetadata.getProperties().getProperty(
                        PersistenceProperties.KUNDERA_CLIENT_FACTORY))) || (paramString != null && clientFactory
                        .equalsIgnoreCase(paramString))))
        {
            readConfigProperties(puMetadata);

            // invoke handle operation.
            if (operation != null && initiateClient())
            {
                tableInfos = tables;
                handleOperations(tables);
            }
        }
    }
209711
function getSchema(connection) {
  const schemaSql = getPrestoSchemaSql(
    connection.prestoCatalog,
    connection.prestoSchema
  );
  return runQuery(schemaSql, connection).then(queryResult =>
    formatSchemaQueryResults(queryResult)
  );
}
814587
@Override
  public OperationHandle getTables(SessionHandle sessionHandle, String catalogName,
      String schemaName, String tableName, List<String> tableTypes)
          throws HiveSQLException {
    try {
      TGetTablesReq req = new TGetTablesReq(sessionHandle.toTSessionHandle());
      req.setTableName(tableName);
      req.setTableTypes(tableTypes);
      req.setSchemaName(schemaName);
      TGetTablesResp resp = cliService.GetTables(req);
      checkStatus(resp.getStatus());
      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
      return new OperationHandle(resp.getOperationHandle(), protocol);
    } catch (HiveSQLException e) {
      throw e;
    } catch (Exception e) {
      throw new HiveSQLException(e);
    }
  }
864914
@Override
    public SchemaManager getSchemaManager(Map<String, Object> puProperties)
    {
        if (schemaManager == null)
        {
            initializePropertyReader();
            externalProperties.put(CassandraConstants.CQL_VERSION, CassandraConstants.CQL_VERSION_3_0);
            externalProperties.put(
                    CassandraConstants.THRIFT_PORT,
                    externalProperties.get(CassandraConstants.THRIFT_PORT) != null ? externalProperties
                            .get(CassandraConstants.THRIFT_PORT) : "9160");
            schemaManager = new CassandraSchemaManager(this.getClass().getName(), externalProperties, kunderaMetadata);
        }
        return schemaManager;

    }
859031
private static ObjectSchema readSchema(String url, String user, String pass,
            SyntaxToJavaClass syntaxToJavaClass, Set<String> binarySet, Set<String> objectClasses) 
        throws NamingException, ClassNotFoundException {
        
        // Set up environment 
        Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(Context.PROVIDER_URL, url);
        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
        if (user != null) {
            env.put(Context.SECURITY_PRINCIPAL, user);
        }
        if (pass != null) {
            env.put(Context.SECURITY_CREDENTIALS, pass);
        }

        DirContext context = new InitialDirContext(env);
        DirContext schemaContext = context.getSchema("");
        SchemaReader reader = new SchemaReader(schemaContext, syntaxToJavaClass, binarySet);
        ObjectSchema schema = reader.getObjectSchema(objectClasses);
        
        if (LOG.isDebugEnabled()) {
            LOG.debug(String.format("Schema - %1$s", schema.toString()));
        }
        
        return schema;  
    }
1219201
@Override
    public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException
    {
        assert(procedureNamePattern != null && !procedureNamePattern.isEmpty());
        checkClosed();
        this.sysCatalog.setString(1, "PROCEDURECOLUMNS");
        JDBC4ResultSet res = (JDBC4ResultSet) this.sysCatalog.executeQuery();
        VoltTable vtable = res.getVoltTable().clone(0);

        // Filter the results based on procedure name and column name
        while (res.next()) {
            if (res.getString("PROCEDURE_NAME").equals(procedureNamePattern)) {
                if (columnNamePattern == null || columnNamePattern.equals("%") ||
                    res.getString("COLUMN_NAME").equals(columnNamePattern)) {
                    vtable.addRow(res.getRowData());
                }
            }
        }

        return new JDBC4ResultSet(sysCatalog, vtable);
    }
1324399
private SchemaManager getSchemaManagerForPu(final String persistenceUnit)
    {
        SchemaManager schemaManager = null;
        Map<String, Object> externalProperties = KunderaCoreUtils.getExternalProperties(persistenceUnit,
                externalPropertyMap, persistenceUnits);
        if (getSchemaProperty(persistenceUnit, externalProperties) != null
                && !getSchemaProperty(persistenceUnit, externalProperties).isEmpty())
        {
            ClientFactory clientFactory = ClientResolver.getClientFactory(persistenceUnit);
            schemaManager = clientFactory != null ? clientFactory.getSchemaManager(externalProperties) : null;
        }
        return schemaManager;
    }
374824
@Override
    public String getSchema(FileSystem fs, Path path) {
        String schema = null;
        try {
            Reader orcReader = OrcFile.createReader(fs, path);
            schema = orcReader.getObjectInspector().getTypeName();
        } catch (IOException e) {
            logger
                .warn("Cannot get schema for file: " + path.toUri().getPath());
            return null;
        }

        return schema;
    }
760591
@Override
    public void exportSchema(String persistenceUnit, List<TableInfo> puToSchemaCol)
    {
        super.exportSchema(persistenceUnit, puToSchemaCol);
    }