SpreadsheetMetadata implements ConnectorMetadata { @Override public List<String> listSchemaNames(ConnectorSession session) { Map<String, Path> schemaMap = getUgi(session).doAs(new MapSchemaNames(session.getUser())); return ImmutableList.copyOf(schemaMap.keySet()); } SpreadsheetMetadata(UserGroupInformation ugi, Configuration configuration, Path basePath,
      String spreadsheetSubDir, boolean useFileCache, boolean proxyUser); @Override List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table,
      Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns); @Override ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle handle); @Override ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle,
      ColumnHandle columnHandle); @Override ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table); @Override Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session,
      SchemaTablePrefix prefix); @Override List<String> listSchemaNames(ConnectorSession session); @Override ConnectorTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName); @Override List<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull); @Override Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle); static SpreadsheetReader getSpreadSheetHelper(UserGroupInformation ugi, ConnectorSession session,
      SpreadsheetTableHandle spreadsheetTableHandle, Configuration configuration, boolean useFileCache); static UserGroupInformation getUgi(ConnectorSession session, boolean proxyUser, UserGroupInformation ugi); static UserGroupInformation getProxyUserGroupInformation(ConnectorSession session, UserGroupInformation ugi);  }
@Test public void testListSchemaNames() throws IOException { Path basePath = setupTest(conf, SESSION.getUser(), SpreadsheetMetadataTest.class); SpreadsheetMetadata spreadsheetMetadata = new SpreadsheetMetadata(ugi, conf, basePath, SPREADSHEETS, useFileCache, true); List<String> listSchemaNames = spreadsheetMetadata.listSchemaNames(SESSION); assertEquals(1, listSchemaNames.size()); assertEquals(SCHEMA_NAME, listSchemaNames.get(0)); }