code: private void executeShowSchema(Tree statement) throws TException, InvalidRequestException
      {
          if (!CliMain.isConnected())
              return;
  
          printCQL3TablesWarning("show schema");
  
          final List<KsDef> keyspaces = thriftClient.describe_keyspaces();
          Collections.sort(keyspaces, new KsDefNamesComparator());
          final String keyspaceName = (statement.getChildCount() == 0)
                                  ? keySpace
                                  : CliCompiler.getKeySpace(statement, keyspaces);
  
          Iterator<KsDef> ksIter;
          if (keyspaceName != null)
              ksIter = Collections2.filter(keyspaces, new Predicate<KsDef>()
              {
                  public boolean apply(KsDef ksDef)
                  {
                      return keyspaceName.equals(ksDef.name);
                  }
              }).iterator();
          else
              ksIter = keyspaces.iterator();
  
          while (ksIter.hasNext())
              showKeyspace(sessionState.out, ksIter.next());
  
          sessionState.out.flush();
      }
docs: SHOW SCHEMA