Skip to content

Commit

Permalink
Prefer SchemaTablePrefix#getSchema to create optional schema name
Browse files Browse the repository at this point in the history
  • Loading branch information
kokosing committed Jan 28, 2019
1 parent 73cc391 commit 1f284a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void dropView(ConnectorSession session, SchemaTableName viewName)
public Map<SchemaTableName, ConnectorViewDefinition> getViews(ConnectorSession session, SchemaTablePrefix prefix)
{
ImmutableMap.Builder<SchemaTableName, ConnectorViewDefinition> builder = ImmutableMap.builder();
for (SchemaTableName stName : listViews(session, Optional.ofNullable(prefix.getSchemaName()))) {
for (SchemaTableName stName : listViews(session, prefix.getSchema())) {
AccumuloView view = client.getView(stName);
if (view != null) {
builder.put(stName, new ConnectorViewDefinition(stName, Optional.empty(), view.getData()));
Expand Down Expand Up @@ -407,7 +407,7 @@ private List<SchemaTableName> listTables(ConnectorSession session, SchemaTablePr
{
// List all tables if schema or table is null
if (prefix.getSchemaName() == null || prefix.getTableName() == null) {
return listTables(session, Optional.ofNullable(prefix.getSchemaName()));
return listTables(session, prefix.getSchema());
}

// Make sure requested table exists, returning the single table of it does
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTable
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
{
ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> tableColumns = ImmutableMap.builder();
for (String schemaName : getSchemaNames(session, Optional.ofNullable(prefix.getSchemaName()))) {
for (String schemaName : getSchemaNames(session, prefix.getSchema())) {
for (Table tpcdsTable : Table.getBaseTables()) {
if (prefix.getTableName() == null || tpcdsTable.getName().equals(prefix.getTableName())) {
ConnectorTableMetadata tableMetadata = getTableMetadata(schemaName, tpcdsTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, Conn
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
{
ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> tableColumns = ImmutableMap.builder();
for (String schemaName : getSchemaNames(session, Optional.ofNullable(prefix.getSchemaName()))) {
for (String schemaName : getSchemaNames(session, prefix.getSchema())) {
for (TpchTable<?> tpchTable : TpchTable.getTables()) {
if (prefix.getTableName() == null || tpchTable.getTableName().equals(prefix.getTableName())) {
ConnectorTableMetadata tableMetadata = getTableMetadata(schemaName, tpchTable, columnNaming);
Expand Down

0 comments on commit 1f284a1

Please sign in to comment.