Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshsanjeev committed Jan 30, 2024
1 parent 7c00062 commit 6e9f53b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1887,10 +1887,19 @@ private static QueryDefinition makeQueryDefinition(
}
} else if (querySpec.getDestination() instanceof ExportMSQDestination) {
final ExportMSQDestination exportMSQDestination = (ExportMSQDestination) querySpec.getDestination();
final StorageConnectorProvider storageConnectorProvider = jsonMapper.convertValue(
exportMSQDestination.getProperties(),
StorageConnectorProvider.class
);
final StorageConnectorProvider storageConnectorProvider;
try {
storageConnectorProvider = jsonMapper.convertValue(
exportMSQDestination.getProperties(),
StorageConnectorProvider.class
);
}
catch (IllegalArgumentException e) {
throw DruidException.forPersona(DruidException.Persona.USER)
.ofCategory(DruidException.Category.RUNTIME_FAILURE)
.build("No storage connector found for storage connector type:[%s].", exportMSQDestination.getStorageConnectorType());
}

final ResultFormat resultFormat = exportMSQDestination.getResultFormat();

// If the statement is a 'REPLACE' statement, delete the existing files at the destination.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.msq.export.TestExportStorageConnector;
import org.apache.druid.msq.test.MSQTestBase;
Expand Down Expand Up @@ -116,11 +117,12 @@ public void testWithUnsupportedStorageConnector()
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.setExpectedExecutionErrorMatcher(
.setExpectedExecutionErrorMatcher(CoreMatchers.allOf(
CoreMatchers.instanceOf(ISE.class),
ThrowableMessageMatcher.hasMessage(CoreMatchers.containsString(
"Could not resolve type id 'hdfs' as a subtype"
))
).verifyExecutionError();
"No storage connector found for storage connector type:[hdfs]."
))))
.verifyExecutionError();
}

private List<Object[]> expectedFooFileContents()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.fasterxml.jackson.databind.InjectableValues;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Binder;
import com.google.inject.Injector;
import com.google.inject.Key;
Expand Down Expand Up @@ -115,12 +114,6 @@ public void createS3StorageFactoryWithMissingTempDir()
);
}

@Test
public void name()
{
ImmutableMap<String, String> stringStringImmutableMap = ImmutableMap.of("type", "local", "basePath", "/path");
}

private StorageConnectorProvider getStorageConnectorProvider(Properties properties)
{
StartupInjectorBuilder startupInjectorBuilder = new StartupInjectorBuilder().add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public String getType()
return tableName;
}

@JsonProperty("tableName")
public String getTableName()
{
return tableName;
}

@Override
public String toString()
{
Expand Down

0 comments on commit 6e9f53b

Please sign in to comment.